aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/api_server.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2024-02-09 15:40:18 +0000
committerAlex <alex@adnab.me>2024-02-09 15:40:18 +0000
commit198188017cc7b956885e4b51c979cb3554276e4f (patch)
tree1aa2708656b02a856b3efd7e4d1c985c91c866ae /src/api/s3/api_server.rs
parentfe175fa8e2b7f8d2f719642b801d4ee101cb3289 (diff)
parent02e98e2d100a6af96369a72bc6979580424fe7df (diff)
downloadgarage-198188017cc7b956885e4b51c979cb3554276e4f.tar.gz
garage-198188017cc7b956885e4b51c979cb3554276e4f.zip
Merge pull request 'Implement header overriding in GetObject (fix #650)' (#713) from header-override-650 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/713
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,