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

write() getting called before writeHead() on gzip'd content causes failures #49

Open
kaysond opened this issue Sep 29, 2018 · 2 comments

Comments

@kaysond
Copy link

kaysond commented Sep 29, 2018

It seems like harmon depends on the assumption that writeHead() gets called before write()

For whatever reason, there are situations where res.writeHead() doesn't get called until after one (or all!) res.write() calls.

So if the content is gzipped, then harmon doesn't set res.isGziped until after some of the data has already been written to the output, and either the gzip'd content gets sent to the output, or gzip fails because it gets only part of the data.

A possible solution would be to check content encoding on the first write() call, and store that.

@leveneg
Copy link
Contributor

leveneg commented Oct 5, 2018

running into a similar issue, in which isHtml isn't getting set. It seems this change over at node-http-proxy has invalidated the assumption that writeHead always gets called first.

@leveneg
Copy link
Contributor

leveneg commented Oct 5, 2018

opened #50 to address this issue

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

No branches or pull requests

2 participants