Merge pull request #3314 from shichanglin5/fix_ETag

File upload should succeed should return `ETag` instead of `Etag`
This commit is contained in:
Chris Lu 2022-07-14 15:35:41 -07:00 committed by GitHub
commit abeb7f65f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -445,9 +445,9 @@ func (s3a *S3ApiServer) putToFiler(r *http.Request, uploadUrl string, dataReader
func setEtag(w http.ResponseWriter, etag string) {
if etag != "" {
if strings.HasPrefix(etag, "\"") {
w.Header().Set("ETag", etag)
w.Header()["ETag"] = []string{etag}
} else {
w.Header().Set("ETag", "\""+etag+"\"")
w.Header()["ETag"] = []string{"\"" + etag + "\""}
}
}
}