diff --git a/CHANGELOG.md b/CHANGELOG.md index 074acb71..7dacb465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This document outlines major changes between releases. - Return appropriate 404 code when object missed in storage but there is in gate cache (#158) - Replace part on re-upload when use multipart upload (#176) - Fix goroutine leak on put object error (#178) +- Fix parsing signed headers in presigned urls (#182) ### Added - Support dump metrics descriptions (#80) diff --git a/api/auth/center.go b/api/auth/center.go index 0d4cc590..76a9c44c 100644 --- a/api/auth/center.go +++ b/api/auth/center.go @@ -153,7 +153,7 @@ func (c *center) Authenticate(r *http.Request) (*Box, error) { Service: creds[3], Region: creds[2], SignatureV4: queryValues.Get(AmzSignature), - SignedFields: queryValues[AmzSignedHeaders], + SignedFields: strings.Split(queryValues.Get(AmzSignedHeaders), ";"), Date: creds[1], IsPresigned: true, } diff --git a/api/auth/presign.go b/api/auth/presign.go index 755ada99..ea34ba15 100644 --- a/api/auth/presign.go +++ b/api/auth/presign.go @@ -34,6 +34,7 @@ func PresignRequest(creds *credentials.Credentials, reqData RequestData, presign } req.Header.Set(AmzDate, presignData.SignTime.Format("20060102T150405Z")) + req.Header.Set(ContentTypeHdr, "text/plain") signer := v4.NewSigner(creds) signer.DisableURIPathEscaping = true