net-http
net-http copied to clipboard
fix character encoding sniffing
This fixes two bugs I found when force_response_body_encoding (#17) is enabled.
scanning_metaonly checks the firstmetaelement- an attribute with no content (for example,
<meta name='keywords' content=''>) breaksget_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?