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

View File

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