From c08f6d0ff74dddc4fe54bc8bcad057b13d64b5a6 Mon Sep 17 00:00:00 2001 From: LHHDZ Date: Thu, 14 Jul 2022 19:45:01 +0800 Subject: [PATCH] File upload should succeed should return `ETag` instead of `Etag` at `/go-1.18.1/src/net/textproto/header.go:39`, header is canonicalized by `textproto.CanonicalMIMEHeaderKey` --- weed/s3api/s3api_object_handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 4ad3454ba..e49d613c4 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -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 + "\""} } } }