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

Lowercasing request headers #34

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

naz
Copy link
Contributor

@naz naz commented Feb 15, 2022

closes #33

Note, this only fixes behavior for the request object. The response object should be investigated for similar pattern and maybe fixed too.

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
closes antongolub#33

- Makes sure incoming header options are always lowercased. This behavior would be the same as in original express request.
Copy link
Owner

@antongolub antongolub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, nice feature. Thanks a lot for the improvement. LGTM

@antongolub antongolub merged commit 5b944f0 into antongolub:master Feb 15, 2022
@antongolub
Copy link
Owner

🎉 This PR is included 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lowercasing headers to match express/node http behavior
2 participants