Browse Source

multiple header values

pull/7523/head
chrislu 2 weeks ago
parent
commit
08314b4688
  1. 7
      weed/s3api/s3_metadata_util.go

7
weed/s3api/s3_metadata_util.go

@ -58,10 +58,9 @@ func ParseS3Metadata(r *http.Request, existing map[string][]byte, isReplace bool
for header, values := range r.Header {
if strings.HasPrefix(header, s3_constants.AmzUserMetaPrefix) {
// Go's HTTP server canonicalizes headers (e.g., x-amz-meta-foo → X-Amz-Meta-Foo)
// We store them as they come in (after canonicalization) to preserve the user's intent
for _, value := range values {
metadata[header] = []byte(value)
}
// Per HTTP and S3 spec: multiple header values are concatenated with commas
// This ensures no metadata is lost when clients send duplicate header names
metadata[header] = []byte(strings.Join(values, ","))
}
}

Loading…
Cancel
Save