Fix Content-Type headers for {admin,k2v} errors and admin responses

Fix #315
This commit is contained in:
Alex Auvolat
2022-05-25 17:05:56 +02:00
parent 93eab8eaa3
commit ff06d3f082
8 changed files with 30 additions and 43 deletions
+1 -3
View File
@@ -150,9 +150,7 @@ impl<A: ApiHandler> ApiServer<A> {
}
Err(e) => {
let body: Body = e.http_body(&self.region, uri.path());
let mut http_error_builder = Response::builder()
.status(e.http_status_code())
.header("Content-Type", "application/xml");
let mut http_error_builder = Response::builder().status(e.http_status_code());
if let Some(header_map) = http_error_builder.headers_mut() {
e.add_http_headers(header_map)