-
Notifications
You must be signed in to change notification settings - Fork 36
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
Headers case-insensitivity #62
Comments
I know, I agree, but there is no efficient way to lowercase all headers. Because we know the source of the request, I thought it would be safe to access the headers with the casing we know is sent by GitHub, plus lowercase just to be sure.
The docs says
I don't get it. Why would |
Yes, but it is not true 😆.
I don't searched why in Ansible code, but all headers are written in Camel-case (even if not modified in debug log ... spent lot of time to catch it).
Is it more complex than searching LowerCase value in an Array 🤔 ? I was started to work on it. |
maybe send a PR to their docs? We could use https://github.com/sindresorhus/lowercase-keys, it's a simple function, but it copies the entire headers object. Maybe we should just do it and safe us more headache in future
|
👍 (Need a simple test to proof it)
I will have a look on headers it (values should not be modified). |
To be precise, the doc speaks about reponse headers, enforced in lowercase (verified), but nothing about request headers. PR: #73702 |
okay let's use https://github.com/sindresorhus/lowercase-keys to be safe.
|
🎉 This issue has been resolved in version 2.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Tested in real life (Ansible smoke tests, probot deployment, ...) / LGTM 👍 |
adapter-aws-lambda-serverless/lambda-function.js
Lines 11 to 14 in d126582
From RFC 7230 > 3.2. Header Fields:
=> If you are testing (sample #61) your Lambda Probot with some tools which can "rewrite" headers (sample: Ansible URI module) like that (in Camel Case):
Note the 'h' in lowercase
It doesn't work 😢. It would be nice if adapter-aws-lambda-serverless could be headers case-insensitive.
Error detail:
NB: False line number, console.log added for debug
The text was updated successfully, but these errors were encountered: