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

AwsLambdaReceiver does not handle request headers propertly #937

Closed
seratch opened this issue May 28, 2021 · 1 comment
Closed

AwsLambdaReceiver does not handle request headers propertly #937

seratch opened this issue May 28, 2021 · 1 comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch
Milestone

Comments

@seratch
Copy link
Member

seratch commented May 28, 2021

@TheManWhoStaresAtCode did you do anything special to set this up?

I tried and I keep getting [WARN] Unexpected content-type detected: undefined. I am still digging in but my lambda is pretty much the example one.

I know it is executing the code because that error is in this bolt code for the PR that added the AwsLambdaReceiver.

Edit:
I did some digging in and noticed that I think the issue is that AWS API Gateway lowercases all the header keys and we are looking for exact case.

Example:
We are looking for a header of Content-Type but my headers come in as "content-type": "application/json", when proxied from API Gateway. Same for "x-slack-signature": "****".

I found the documentation that indicates that headers are lower cased. One added detail is that we are using http api vs Rest API on AWS API Gateway.
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

Originally posted by @JSSAggie in #815 (comment)

@gitwave gitwave bot added the untriaged label May 28, 2021
@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch and removed untriaged labels May 28, 2021
@seratch seratch added this to the 3.4.0 milestone May 28, 2021
TheManWhoStaresAtCode added a commit to TheManWhoStaresAtCode/bolt-js that referenced this issue May 28, 2021
TheManWhoStaresAtCode added a commit to TheManWhoStaresAtCode/bolt-js that referenced this issue May 29, 2021
seratch pushed a commit that referenced this issue May 31, 2021
* ignore casing of HTTP headers as requested by RFC (#937)
* Update src/receivers/AwsLambdaReceiver.ts
* fix typo (#937)
Co-authored-by: Kazuhiro Sera <seratch@gmail.com>
@seratch
Copy link
Member Author

seratch commented May 31, 2021

Fixed by #938 - Thanks @TheManWhoStaresAtCode for your contribution!

@seratch seratch closed this as completed May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch
Projects
None yet
Development

No branches or pull requests

1 participant