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

Case-insensitively check the content-encoding header #21

Merged
merged 4 commits into from
Aug 12, 2019
Merged

Case-insensitively check the content-encoding header #21

merged 4 commits into from
Aug 12, 2019

Conversation

bodinsamuel
Copy link
Contributor

Some server are uppercasing the content-encoding header.

Example to reproduce:
https://typespublisher.blob.core.windows.net/typespublisher/data/search-index-min.json

@sindresorhus
Copy link
Owner

Would probably be better to switch to use https://nodejs.org/api/http.html#http_response_getheader_name

@bodinsamuel
Copy link
Contributor Author

I never used this but I don't think got is passing a Nodejs Http Response object (based on my test right now at least it trigger a TypeError: response.getHeader is not a function), and that would be a breaking change for other packages using this one.

@sindresorhus sindresorhus changed the title Check header in lowercase Case-insensitively check the content-encoding header Aug 12, 2019
@sindresorhus
Copy link
Owner

Ah, you're right. I confused it with the server response object.

@sindresorhus sindresorhus merged commit 01397b5 into sindresorhus:master Aug 12, 2019
@bodinsamuel
Copy link
Contributor Author

Thanks a lot 💪

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

Successfully merging this pull request may close these issues.

2 participants