mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/htp/response.rb (Net::Inflater#inflate_adapter):
prevent automatic encoding conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6811973d13
commit
d8a2c3c03f
2 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Jul 4 04:42:05 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/net/htp/response.rb (Net::Inflater#inflate_adapter):
|
||||
prevent automatic encoding conversion.
|
||||
|
||||
Fri Jul 4 04:39:52 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/net/http/response.rb (Net::HTTPResponse.each_response_header):
|
||||
|
|
|
@ -369,6 +369,11 @@ class Net::HTTPResponse
|
|||
# entire body in memory.
|
||||
|
||||
def inflate_adapter(dest)
|
||||
if dest.respond_to?(:set_encoding)
|
||||
dest.set_encoding(Encoding::ASCII_8BIT)
|
||||
elsif dest.respond_to?(:force_encoding)
|
||||
dest.force_encoding(Encoding::ASCII_8BIT)
|
||||
end
|
||||
block = proc do |compressed_chunk|
|
||||
@inflate.inflate(compressed_chunk) do |chunk|
|
||||
dest << chunk
|
||||
|
|
Loading…
Reference in a new issue