зеркало из https://github.com/github/ruby.git
* 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:
Родитель
6811973d13
Коммит
d8a2c3c03f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче