Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When provided a TE header the request signature does not match the calculated signature. #155

Open
Mi3-14159 opened this issue Jul 21, 2023 · 0 comments

Comments

@Mi3-14159
Copy link

Mi3-14159 commented Jul 21, 2023

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.

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.

@Mi3-14159 Mi3-14159 changed the title When provided a TE header the request signature does not match the calculated signature. When provided a TE header the request signature does not match the calculated signature. Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant