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

Add support for Brotli compression #650

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

weshatheleopard
Copy link
Contributor

@weshatheleopard weshatheleopard commented Jul 28, 2024

Closes #649

@flavorjones flavorjones changed the title Fixes Issue #649 Add support for Brotli compression Jul 28, 2024
@flavorjones
Copy link
Member

This is great! I made a few changes to ensure Brotli is an optional dependency, otherwise I'm happy with this for initial (experimental?) support.

Do you happen to know of a server that is problematic in this way, so I can manually test against a real-world scenario?

- move dev deps to the Gemfile
- brotli is not a dev dep for jruby (which it doesn't support)
- test how brotli responses are handled when Brotli is not loaded
@weshatheleopard
Copy link
Contributor Author

weshatheleopard commented Jul 29, 2024

I am not able to give you the original URL due to non-disclosure concerns, but I found a random one that exhibits the same behavor. Here's the snippet that causes crash in Mechanize 2.11.0:

Mechanize.new.get "https://cdn-gcore-1.rutube.ru/hls-vod/kpX2iQ76VfR0m8SMxEB4dA/1722717434/2161/0x5000c500e74e86cf/164fd2fc7da34bb8bef101c04401cdb6.mp4.m3u8"

P.S. Told you you will butcher my code to the point of uncrecognizeability! =^.~=

@flavorjones
Copy link
Member

P.S. Told you you will butcher my code to the point of uncrecognizeability

I really wish you wouldn't do this. Your implementation and the initial test was fine and saved me a lot of time. Thank you.

Thanks for the link, I've manually verified this seems to work and will ship a release today.

@flavorjones flavorjones merged commit 1636348 into sparklemotion:main Jul 29, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

Feature Request: Handle responses that require Brotli compression
2 participants