No9 / harmon

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

Content encoding chunked / mime types #15

Closed GuyPaddock closed 9 years ago

GuyPaddock commented 9 years ago

It doesn't seem like Harmon works correctly when the proxy is serving up image content and the server is sending back the data using "chunked" content-encoding.

I would guess that the logic that determines whether or not to act on HTML only should base the decision on the mime type rather than the file extension.

GuyPaddock commented 9 years ago

Okay, it looks like the content-encoding isn't the problem. It's that Harmon causes the binary response to be mangled somehow.

GuyPaddock commented 9 years ago

Just solved this in my own fork: https://github.com/GuyPaddock/harmon-binary

The fork distinguishes between HTML and non-HTML responses, and invokes Trumpet accordingly.

No9 commented 9 years ago

Hi @GuyPaddock
Harmon is open open source always happy to add significant contributers to the repo. Please consider adding your modification as a pull request Thanks

GuyPaddock commented 9 years ago

I have prepared a PR. Good advice -- I had not run the tests and discovered a subtle, fatal flaw in the way the new code was working.