mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix: set user metadata key to lowercase (#3894)
* fix: set user metadata key to lowercase * feat: simplify a bit
This commit is contained in:
parent
091f999e8c
commit
25e012d30b
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue