From 241c56e6d76baf1854675d011172b461017b3a79 Mon Sep 17 00:00:00 2001 From: Kevin Qiu Date: Tue, 13 Sep 2016 13:59:40 -0400 Subject: [PATCH] Use Set instead of Add in the event that the request already contains the content-length (#2683) --- cmd/signature-v4.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/signature-v4.go b/cmd/signature-v4.go index a8e8af845..d1bd96ab4 100644 --- a/cmd/signature-v4.go +++ b/cmd/signature-v4.go @@ -354,7 +354,7 @@ func doesSignatureMatch(hashedPayload string, r *http.Request, validateRegion bo for _, h := range signV4Values.SignedHeaders { if h == "content-length" { header = cloneHeader(req.Header) - header.Add("content-length", strconv.FormatInt(r.ContentLength, 10)) + header.Set("content-length", strconv.FormatInt(r.ContentLength, 10)) break } }