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
+3 -2
View File
@@ -72,8 +72,9 @@ impl ApiError for Error {
}
}
fn add_http_headers(&self, _header_map: &mut HeaderMap<HeaderValue>) {
// nothing
fn add_http_headers(&self, header_map: &mut HeaderMap<HeaderValue>) {
use hyper::header;
header_map.append(header::CONTENT_TYPE, "application/json".parse().unwrap());
}
fn http_body(&self, garage_region: &str, path: &str) -> Body {