From 7bf14452f7882c803c7c86dcb7b81be65bf2934e Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 12 Dec 2021 23:05:40 -0800 Subject: [PATCH] s3: handle Response-Content-Disposition --- weed/server/filer_server_handlers_write_autochunk.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index 80e623561..61d30372b 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -224,8 +224,13 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa entry.Extended = SaveAmzMetaData(r, entry.Extended, false) for k, v := range r.Header { - if len(v) > 0 && len(v[0]) > 0 && (strings.HasPrefix(k, needle.PairNamePrefix) || k == "Cache-Control" || k == "Expires" || k == "Content-Disposition") { - entry.Extended[k] = []byte(v[0]) + if len(v) > 0 && len(v[0]) > 0 { + if strings.HasPrefix(k, needle.PairNamePrefix) || k == "Cache-Control" || k == "Expires" || k == "Content-Disposition" { + entry.Extended[k] = []byte(v[0]) + } + if k == "Response-Content-Disposition" { + entry.Extended["Content-Disposition"] = []byte(v[0]) + } } }