forked from Deuxfleurs/garage
use proper error code for unsupported anonymous s3 access
This commit is contained in:
parent
945b75dbf1
commit
914dd0559c
1 changed files with 3 additions and 3 deletions
|
@ -165,9 +165,9 @@ fn parse_authorization(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_query_authorization(headers: &HashMap<String, String>) -> Result<Authorization, Error> {
|
fn parse_query_authorization(headers: &HashMap<String, String>) -> Result<Authorization, Error> {
|
||||||
let algo = headers
|
let algo = headers.get("x-amz-algorithm").ok_or_else(|| {
|
||||||
.get("x-amz-algorithm")
|
Error::Forbidden("Garage does not support anonymous users yet".to_owned())
|
||||||
.ok_or_bad_request("X-Amz-Algorithm not found in query parameters")?;
|
})?;
|
||||||
if algo != "AWS4-HMAC-SHA256" {
|
if algo != "AWS4-HMAC-SHA256" {
|
||||||
return Err(Error::BadRequest(
|
return Err(Error::BadRequest(
|
||||||
"Unsupported authorization method".to_string(),
|
"Unsupported authorization method".to_string(),
|
||||||
|
|
Loading…
Reference in a new issue