-
Notifications
You must be signed in to change notification settings - Fork 2
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
Lowercasing headers to match express/node http behavior #33
Labels
Comments
naz
added a commit
to naz/reqresnext
that referenced
this issue
Feb 15, 2022
refs antongolub#33 - Adds utility that will help mimicing lowercasing of headers like it's done in express' Request object - Code heavily inspired by https://github.com/howardabrams/node-mocks-http/blob/a0ad193459c102069a9b7de386f16ebf59cab6e0/lib/utils.js#L3-L9
naz
added a commit
to naz/reqresnext
that referenced
this issue
Feb 15, 2022
closes antongolub#33 - Makes sure incoming header options are always lowercased. This behavior would be the same as in original express request.
naz
added a commit
to naz/framework
that referenced
this issue
Feb 15, 2022
refs https://github.com/TryGhost/Toolbox/issues/209 refs antongolub/reqresnext#33 - This test should start passing once the upstream dependency (reqresnext) has the referenced issue fixed
naz
added a commit
to naz/framework
that referenced
this issue
Feb 15, 2022
refs https://github.com/TryGhost/Toolbox/issues/209 refs antongolub/reqresnext#33 - This test should start passing once the upstream dependency (reqresnext) has the referenced issue fixed
naz
added a commit
to naz/framework
that referenced
this issue
Feb 15, 2022
refs https://github.com/TryGhost/Toolbox/issues/209 refs antongolub/reqresnext#33 - All request headers should be lowercased to match the default behavior in express and node's http module. These patches should be removed once the upstream issue is solved
naz
added a commit
to TryGhost/framework
that referenced
this issue
Feb 15, 2022
refs https://github.com/TryGhost/Toolbox/issues/209 refs antongolub/reqresnext#33 - This test should start passing once the upstream dependency (reqresnext) has the referenced issue fixed
naz
added a commit
to TryGhost/framework
that referenced
this issue
Feb 15, 2022
refs https://github.com/TryGhost/Toolbox/issues/209 refs antongolub/reqresnext#33 - All request headers should be lowercased to match the default behavior in express and node's http module. These patches should be removed once the upstream issue is solved
antongolub
pushed a commit
that referenced
this issue
Feb 15, 2022
refs #33 - Adds utility that will help mimicing lowercasing of headers like it's done in express' Request object - Code heavily inspired by https://github.com/howardabrams/node-mocks-http/blob/a0ad193459c102069a9b7de386f16ebf59cab6e0/lib/utils.js#L3-L9
antongolub
pushed a commit
that referenced
this issue
Feb 15, 2022
closes #33 - Makes sure incoming header options are always lowercased. This behavior would be the same as in original express request.
🎉 This issue has been resolved in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
refs #33 (issue in the upstream dependency)
Node's native http module lowercases incoming headers in the request object (reference). The lowrcasing does not happen when using reqresnext library causing behavior different to production. For example when a
miXed-caSe-header: some_value
is passed in with an incoming HTTP request, thereq['mixed-case-header']
isundefined
.For reference this is how the node-mocks-http, referenced in this project's readme, solves a very similar issue:
And excerpt from utils lib:
I think a correct solution here would be setting lowercased headers to fully mimic express' behavior.
The text was updated successfully, but these errors were encountered: