-
Notifications
You must be signed in to change notification settings - Fork 961
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
Encoding Incorrect when Streaming Response #643
Comments
@mvastola Hi! Thanks for reporting. Yeah, you're right. Seems like we've forgot about this case. |
Thanks so much! |
@mvastola I've finally merged the request. Sorry to keep you waiting. gem 'httparty', github: 'jnunemaker/httparty' |
No worries! Thanks again! |
I'm running into an issue where the encoding is not set according to the response HTTP headers when using
:stream_body => true
.I've provided a minimal reproducible example in a gist at https://git.io/fhSBB.
In short, if I look at
req.headers['content-type']
I (correctly) see["text/html;charset=UTF-8"]
andreq.body.encoding
returnsUTF-8
. However, for whatever reason,fragment.encoding
(fragment
being the argument to the block provided toHTTParty.get(URL, :stream_body => true)
) isASCII-8BIT
.Oddly, it works fine when not using streaming.
I'm happy to help troubleshoot this if there's any way I can be of help. Any assistance would be appreciated.
The text was updated successfully, but these errors were encountered: