No9 / harmon

middleware for node-http-proxy to modify the remote website response with trumpet
Other
424 stars 62 forks source link

gzip content length issue #37

Closed reykjavikingur closed 8 years ago

reykjavikingur commented 8 years ago

I'm running a proxy whose target uses gzip content-encoding and content-length headers. The proxy works fine until I introduce the harmon middleware without even any selectors:

app.use(harmon([], []))

Many of the proxy responses are getting truncated. I presume this is because the content is being decompressed (gunzip'd) but the content length is not being changed.

I've used harmon on proxy targets without gzip encoding or content lengths and have not had any issues. What do you recommend for a workaround?

reykjavikingur commented 8 years ago

On further research, the truncation seems to be caused by time-outs in very large non-HTML files from the proxy target. Why is harmon parses non-HTML files like images and JS files?? How do I restrict it to HTML only?

reykjavikingur commented 8 years ago

Never mind. I'm getting too many issues mixed up.