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

Gzip compression is skipped when content-length is unknown #2869

Closed
nlindley opened this issue Oct 23, 2015 · 1 comment
Closed

Gzip compression is skipped when content-length is unknown #2869

nlindley opened this issue Oct 23, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@nlindley
Copy link
Contributor

@nlindley nlindley commented Oct 23, 2015

I ran across an issue that when replying with a stream of unknown length, gzip compression is skipped. It looks like the issue stems from assuming the content-length is 0 if the header has not been set.

https://github.com/hapijs/hapi/blob/master/lib/transmit.js#L183

As far as I can tell, the check for length first appeared in this commit.

96083e3#diff-1b255634e333bd5cd92f5b48c61e72cbR224

@kanongil
Copy link
Contributor

@kanongil kanongil commented Oct 23, 2015

Thanks. This definitely seems like a bug. I have submitted a PR to fix this in #2870, which also includes a fix to a more serious bug when response.emptyStatusCode === 204.

@hueniverse hueniverse added the bug label Oct 23, 2015
@hueniverse hueniverse added this to the 11.0.3 milestone Oct 23, 2015
@hueniverse hueniverse self-assigned this Oct 23, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants