Sign function should return headers passed to it
Opened this issue · 0 comments
Deleted user commented
I kept running into issues with the signature not matching the one generated by AWS. The problem turned out to be missing headers passed to the sign
function. This resolved the issue:
var signedHeaders = try signer.sign(payload: Payload.bytes(parameterString.bytes), method: .post, path: "/", headers: ["content-type": "application/x-www-form-urlencoded; charset=utf-8"])
signedHeaders[.contentType] = "application/x-www-form-urlencoded; charset=utf-8" // solved issue
I think the sign function should return the headers that are passed to it. What do you guys think?