support parseObjectAttributes to handle multiple header values (#20295)

This commit is contained in:
Mark Theunissen
2024-08-22 07:13:59 +10:00
committed by GitHub
parent a8ff12bc72
commit fb4ad000b6
2 changed files with 84 additions and 3 deletions

View File

@@ -225,9 +225,11 @@ func getAndValidateAttributesOpts(ctx context.Context, w http.ResponseWriter, r
func parseObjectAttributes(h http.Header) (attributes map[string]struct{}) {
attributes = make(map[string]struct{})
for _, v := range strings.Split(strings.TrimSpace(h.Get(xhttp.AmzObjectAttributes)), ",") {
if v != "" {
attributes[v] = struct{}{}
for _, headerVal := range h.Values(xhttp.AmzObjectAttributes) {
for _, v := range strings.Split(strings.TrimSpace(headerVal), ",") {
if v != "" {
attributes[v] = struct{}{}
}
}
}