Skip to content
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

Don't delete content-length before yielding inflate body #50

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/net/http/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def inflater # :nodoc:
case v&.downcase
when 'deflate', 'gzip', 'x-gzip' then
self.delete 'content-encoding'
had_content_length = self.delete 'content-length'

inflate_body_io = Inflater.new(@socket)

Expand All @@ -273,7 +272,7 @@ def inflater # :nodoc:
ensure
begin
inflate_body_io.finish
if had_content_length
if self['content-length']
self['content-length'] = inflate_body_io.bytes_inflated.to_s
end
rescue => err
Expand Down