aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/api_server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-09 15:34:42 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-09 15:58:46 +0100
commit02e98e2d100a6af96369a72bc6979580424fe7df (patch)
treeda13072233d0da8f869d2c839fb486ce30e4b8cf /src/api/s3/api_server.rs
parent3865080c354427f913de6f2bb5e5b03f6231751c (diff)
downloadgarage-02e98e2d100a6af96369a72bc6979580424fe7df.tar.gz
garage-02e98e2d100a6af96369a72bc6979580424fe7df.zip
[header-override-650] implement header overriding in GetObject (fix #650)header-override-650
Diffstat (limited to 'src/api/s3/api_server.rs')
-rw-r--r--src/api/s3/api_server.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/api/s3/api_server.rs b/src/api/s3/api_server.rs
index 0065ca59..7fac6261 100644
--- a/src/api/s3/api_server.rs
+++ b/src/api/s3/api_server.rs
@@ -178,8 +178,26 @@ impl ApiHandler for S3ApiServer {
key, part_number, ..
} => handle_head(garage, &req, bucket_id, &key, part_number).await,
Endpoint::GetObject {
- key, part_number, ..
- } => handle_get(garage, &req, bucket_id, &key, part_number).await,
+ key,
+ part_number,
+ response_cache_control,
+ response_content_disposition,
+ response_content_encoding,
+ response_content_language,
+ response_content_type,
+ response_expires,
+ ..
+ } => {
+ let overrides = GetObjectOverrides {
+ response_cache_control,
+ response_content_disposition,
+ response_content_encoding,
+ response_content_language,
+ response_content_type,
+ response_expires,
+ };
+ handle_get(garage, &req, bucket_id, &key, part_number, overrides).await
+ }
Endpoint::UploadPart {
key,
part_number,