ml-archive / aws

Swift wrapper around AWS API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sign function should return headers passed to it

opened this issue · comments

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?