Improved bucket authorization response strings.

This commit is contained in:
Jonathan Davies
2023-01-29 20:27:15 +00:00
parent 004bb5b4f1
commit 9c354f0a8f
2 changed files with 13 additions and 9 deletions
+10 -6
View File
@@ -119,12 +119,16 @@ impl AdminApiServer {
let bucket_website_config = bucket_state.website_config.get();
match bucket_website_config {
Some(_v) => Ok(Response::builder()
.status(StatusCode::OK)
.body(Body::from("Bucket authorized for website hosting"))?),
None => Err(Error::bad_request(
"Bucket is not authorized for website hosting",
)),
Some(_v) => {
Ok(Response::builder()
.status(StatusCode::OK)
.body(Body::from(format!(
"Bucket '{domain}' is authorized for website hosting"
)))?)
}
None => Err(Error::bad_request(format!(
"Bucket '{domain}' is not authorized for website hosting"
))),
}
}