No9 / harmon

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

No selector callbacks being invoked for certain sites #54

Open justinhelmer opened 3 years ago

justinhelmer commented 3 years ago

I apologize if this is actually an issue with the underlying trumpet module but this seems like the right place to start.

For some sites, everything works perfectly. For others, no selector matching works. Digging into the code, I can see that the selectors are being registered with tr.selectAll (one for head and one for body), but the callbacks are being invoked.

The only obvious difference between the two sites is that one is gzipped and one is not.

To reproduce:

in head
in body

Any help would be greatly appreciated.

No9 commented 3 years ago

If it is due to the gzip content you may need to look at the gzip example https://github.com/No9/harmon/blob/master/examples/gzipped.js

justinhelmer commented 3 years ago

It is actually the non-gzipped URL that is not working.

Also from what I can tell by reading through the source, gzip is supported by this module already (as is proof by the fact that the gzipped page intellimize is working)