diff options
author | Alex Auvolat <alex@adnab.me> | 2020-07-09 17:04:43 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-07-09 17:04:43 +0200 |
commit | 9305e5e87f947172984f60742c1d96d42acb5950 (patch) | |
tree | ad5f94d5c4c07c3b5d239942379fc1a1bf750467 /src/api/s3_get.rs | |
parent | 44dba0e53c7bae0fa16bf48e6022faa95d1159aa (diff) | |
download | garage-9305e5e87f947172984f60742c1d96d42acb5950.tar.gz garage-9305e5e87f947172984f60742c1d96d42acb5950.zip |
More headers taken into account
Diffstat (limited to 'src/api/s3_get.rs')
-rw-r--r-- | src/api/s3_get.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/api/s3_get.rs b/src/api/s3_get.rs index a3a20d49..77939342 100644 --- a/src/api/s3_get.rs +++ b/src/api/s3_get.rs @@ -19,16 +19,21 @@ fn object_headers( let date = UNIX_EPOCH + Duration::from_millis(version.timestamp); let date_str = httpdate::fmt_http_date(date); - Response::builder() + let mut resp = Response::builder() .header( "Content-Type", version_meta.headers.content_type.to_string(), ) - // TODO: other headers .header("Content-Length", format!("{}", version_meta.size)) .header("ETag", version_meta.etag.to_string()) .header("Last-Modified", date_str) - .header("Accept-Ranges", format!("bytes")) + .header("Accept-Ranges", format!("bytes")); + + for (k, v) in version_meta.headers.other.iter() { + resp = resp.header(k, v.to_string()); + } + + resp } pub async fn handle_head( |