amazonka
amazonka copied to clipboard
presigned URL has invalid signature when S3 PutObject contains tagging
This produces a URL with valid signature:
A.presignURL
env
signingTime
expirationSec
(newPutObject bucketName objectKey (A.toBody B.empty))
However, this produces a URL with invalid signature:
A.presignURL
env
signingTime
expirationSec
( (newPutObject bucketName objectKey (A.toBody B.empty))
{ tagging = Just tagSetTxt
}
)
AWS responds with:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
SignedHeaders changes:
- X-Amz-SignedHeaders=host
+ X-Amz-SignedHeaders=host%3Bx-amz-tagging
It seems here are some insights: https://stackoverflow.com/a/77418874/1663197.
I use Amazonka 2.0.
Taggings are encoded as query parameters. I recently fixed a bug with request signing of query parameters; can you check latest main and see if this is still an issue? Thanks.