forked from Deuxfleurs/garage
Clarify error message
This commit is contained in:
parent
17ea28a438
commit
3586c7257c
2 changed files with 10 additions and 9 deletions
|
@ -127,7 +127,8 @@ pub async fn handle_create_bucket(
|
||||||
if let Some(location_constraint) = cmd {
|
if let Some(location_constraint) = cmd {
|
||||||
if location_constraint != garage.config.s3_api.s3_region {
|
if location_constraint != garage.config.s3_api.s3_region {
|
||||||
return Err(Error::BadRequest(format!(
|
return Err(Error::BadRequest(format!(
|
||||||
"Buckets must be created in region {}",
|
"Cannot satisfy location constraint `{}`: buckets can only be created in region `{}`",
|
||||||
|
location_constraint,
|
||||||
garage.config.s3_api.s3_region
|
garage.config.s3_api.s3_region
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1015,14 +1015,14 @@ mod tests {
|
||||||
)*
|
)*
|
||||||
}};
|
}};
|
||||||
|
|
||||||
(@actual_method HEAD) => {{ "HEAD" }};
|
(@actual_method HEAD) => {{ "HEAD" }};
|
||||||
(@actual_method GET) => {{ "GET" }};
|
(@actual_method GET) => {{ "GET" }};
|
||||||
(@actual_method OWNER_GET) => {{ "GET" }};
|
(@actual_method OWNER_GET) => {{ "GET" }};
|
||||||
(@actual_method PUT) => {{ "PUT" }};
|
(@actual_method PUT) => {{ "PUT" }};
|
||||||
(@actual_method OWNER_PUT) => {{ "PUT" }};
|
(@actual_method OWNER_PUT) => {{ "PUT" }};
|
||||||
(@actual_method POST) => {{ "POST" }};
|
(@actual_method POST) => {{ "POST" }};
|
||||||
(@actual_method DELETE) => {{ "DELETE" }};
|
(@actual_method DELETE) => {{ "DELETE" }};
|
||||||
(@actual_method OWNER_DELETE) => {{ "DELETE" }};
|
(@actual_method OWNER_DELETE) => {{ "DELETE" }};
|
||||||
|
|
||||||
(@auth HEAD $uri:expr) => {{
|
(@auth HEAD $uri:expr) => {{
|
||||||
assert_eq!(parse("HEAD", concat!("/my_bucket", $uri), None, None).authorization_type(),
|
assert_eq!(parse("HEAD", concat!("/my_bucket", $uri), None, None).authorization_type(),
|
||||||
|
|
Loading…
Reference in a new issue