-
Notifications
You must be signed in to change notification settings - Fork 36
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
Minifier plugin triggers a Content encoding error if content is compressed with brotli by the target server #47
Comments
From what I understand, this looks like a feature ordering issue in the transcoding section. The issue never happens with pictures, because pictures never get compressed over HTTP, as compressing an already compressed file is pointless, wastes CPU resources, and bandwidth. The Content Encoding Error never happens with the |
Just had a quick look at the relevant code and I see no attempt to ever
decompress brotli received from the server. My guess is that the compressed
content is passed to the minifier as is and gets corrupted.
|
Ignore my second post, I didn't dig enough into the code to understand it well. The zip modules never decompresses brotli. I've just performed tests with this gist, which solved the issue. |
Just pushed a branch called brotli-dec but unfortunately I don't have a
setup avaiable to test any changes at the moment. It's very similar to
yours, the SkipCompressed flag is just a kind of optimization to avoid
decompressing/recompressing content with the same algo when no other
transcoding is required.
|
We might experience similar issues if unsupported encodings are advertised by the client and supported by the target server (e.g.
Edit: I'll check your branch this evening. |
Could you add a test to |
That would be difficult to test internally, because:
|
I'm performing tests with mitm + minifier enabled and Firefox 63.0 (nightly), which works fine on the sites I've had issues with. |
Hi,
For a reason unknown to me, compy triggers Content encoding errors on the client when both the browser and the target server support brotli, and when the minifier plugin is enabled.
Known failure cases which triggers Content encoding errors are:
One solution to circumvent the issue is to mask
br
when passing theAccept-encoding
headers, if the minify plugin is enabled.The more elegant one would be to check why the content isn't encoded back in brotli when processed by the minify plugin.
Kind regards,
The text was updated successfully, but these errors were encountered: