net-http icon indicating copy to clipboard operation
net-http copied to clipboard

fix character encoding sniffing

Open granth opened this issue 2 years ago • 0 comments

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?

granth avatar Jul 06 '23 18:07 granth