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

fix character encoding sniffing #142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

granth
Copy link

@granth granth commented Jul 6, 2023

This fixes two bugs I found when force_response_body_encoding (#17) is enabled.

  1. scanning_meta only checks the first meta element
  2. an attribute with no content (for example, <meta name='keywords' content=''>) breaks get_attribute

The scanning_meta change makes the code more similar to the original sniffing patch in https://bugs.ruby-lang.org/issues/2567. There may be an issue with the while and large content bodies. Maybe it should stop at <body> as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant