I am sending requests from Firefox to a Lambda Function URL and everything is fine in chrome, but when using Firefox i get this error The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
After breaking it down i figured out that firefox sends a TE header and chrome doesn't. And after playing around in a script i can confirm that this is the only issue.
let request = {
host: '<HOST>',
method: 'POST',
url: `<URL>`,
data: body,
body: JSON.stringify(body),
path: `<PATH>`,
headers: {
'content-type': 'application/json',
'TE': 'trailers', // comment this line out to make it work
},
service: 'lambda',
region: 'eu-central-1'
}
let signedRequest = aws4.sign(request,
{
secretAccessKey: '<SECRET_ACCESS_KEY>',
accessKeyId: '<ACCESS_KEY_ID>',
sessionToken: '<SESSION_TOKEN>',
})
I also tried this example in python with the same result, a mismatched signature.
Expected behavior
Send signature matches the calculated and the request is valid.
Description
I am sending requests from Firefox to a Lambda Function URL and everything is fine in chrome, but when using Firefox i get this error
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
After breaking it down i figured out that firefox sends a
TE
header and chrome doesn't. And after playing around in a script i can confirm that this is the only issue.I also tried this example in python with the same result, a mismatched signature.
Expected behavior
Send signature matches the calculated and the request is valid.