Use Set instead of Add in the event that the request already contains the content-length (#2683)

This commit is contained in:
Kevin Qiu 2016-09-13 13:59:40 -04:00 committed by Harshavardhana
parent 895471afa1
commit 241c56e6d7

View File

@ -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
}
}