diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 8c4e3f0e8..37851b147 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -409,10 +409,22 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des return } + setUserMetadataKeyToLowercase(resp) + responseStatusCode := responseFn(resp, w) s3err.PostLog(r, responseStatusCode, s3err.ErrNone) } +func setUserMetadataKeyToLowercase(resp *http.Response) { + for key, value := range resp.Header { + if strings.HasPrefix(key, s3_constants.AmzUserMetaPrefix) { + resp.Header[strings.ToLower(key)] = value + delete(resp.Header,key) + continue + } + } +} + func passThroughResponse(proxyResponse *http.Response, w http.ResponseWriter) (statusCode int) { for k, v := range proxyResponse.Header { w.Header()[k] = v