s3: handle Response-Content-Disposition

This commit is contained in:
chrislu 2021-12-12 23:05:40 -08:00
parent 94e5c0a454
commit 7bf14452f7

View file

@ -224,9 +224,14 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
entry.Extended = SaveAmzMetaData(r, entry.Extended, false) entry.Extended = SaveAmzMetaData(r, entry.Extended, false)
for k, v := range r.Header { 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") { 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]) entry.Extended[k] = []byte(v[0])
} }
if k == "Response-Content-Disposition" {
entry.Extended["Content-Disposition"] = []byte(v[0])
}
}
} }
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil); dbErr != nil { if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil); dbErr != nil {