aboutsummaryrefslogtreecommitdiff
path: root/src/api/k2v/error.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-25 17:05:56 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-25 17:09:33 +0200
commitff06d3f0829464863e64ed55471f2caa13bed191 (patch)
tree2ba08f439721c28d326badc0a33f148ee1fbdce1 /src/api/k2v/error.rs
parent93eab8eaa3927b99626fee4a747a0f9f041cafdb (diff)
downloadgarage-ff06d3f0829464863e64ed55471f2caa13bed191.tar.gz
garage-ff06d3f0829464863e64ed55471f2caa13bed191.zip
Fix Content-Type headers for {admin,k2v} errors and admin responsesfix/admin-api-content-type
Fix #315
Diffstat (limited to 'src/api/k2v/error.rs')
-rw-r--r--src/api/k2v/error.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/k2v/error.rs b/src/api/k2v/error.rs
index 4c55d8b5..42491466 100644
--- a/src/api/k2v/error.rs
+++ b/src/api/k2v/error.rs
@@ -110,8 +110,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 {