aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_get.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2020-12-06 15:27:58 +0100
committerAlex <alex@adnab.me>2020-12-06 15:27:58 +0100
commit857440f19215422798dcda44cf85bfce439e9032 (patch)
treeb62af2c15d29e9fd061d884ff9856962bef6cf2a /src/api/s3_get.rs
parent39f45b3058e0d6705bdd94037c0876a2af6d5a74 (diff)
parent4a5bbbb81088c9bd25bbe142f67daf4669b6538e (diff)
downloadgarage-857440f19215422798dcda44cf85bfce439e9032.tar.gz
garage-857440f19215422798dcda44cf85bfce439e9032.zip
Merge pull request 'Propose ETag fix' (#23) from bug/etag into master
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/23
Diffstat (limited to 'src/api/s3_get.rs')
-rw-r--r--src/api/s3_get.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/s3_get.rs b/src/api/s3_get.rs
index 43215923..1a23f476 100644
--- a/src/api/s3_get.rs
+++ b/src/api/s3_get.rs
@@ -24,10 +24,13 @@ fn object_headers(
"Content-Type",
version_meta.headers.content_type.to_string(),
)
- .header("ETag", version_meta.etag.to_string())
.header("Last-Modified", date_str)
.header("Accept-Ranges", format!("bytes"));
+ if !version_meta.etag.is_empty() {
+ resp = resp.header("ETag", format!("\"{}\"", version_meta.etag));
+ }
+
for (k, v) in version_meta.headers.other.iter() {
resp = resp.header(k, v.to_string());
}