Project

General

Profile

Actions

Backport #7831

closed

Net::HTTP does not allow users to handle Content-Encoding in responses like 1.x

Added by drbrain (Eric Hodel) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:52134]

Description

I added a feature to always add a feature to always add Accept-Encoding to HTTP requests and always decode HTTP responses with Content-Encoding.

On Ruby 1.9 and older you could handle Content-Encoding for yourself.

Now Ruby always handles Content-Encoding for you, but does not give you a good indicator that this has taken place. In mechanize this leads to an incompatibility as the Content-Length header is not updated from the original value.

This also disallows handling of bad server responses that browsers handle.

The attached patch (upcoming) addresses this by only handling Content-Decoding in a response if the user did not override the Accept-Encoding header.

Since this is an incompatibility I would like this fixed for Ruby 2.0. Sorry I did not catch it sooner, I was too busy with RubyGems and RDoc.


Files

net.http.user_handled_content_encoding.patch (6.72 KB) net.http.user_handled_content_encoding.patch Patch to allow users to control content-encoding drbrain (Eric Hodel), 02/12/2013 09:10 AM

Related issues

Related to Backport200 - Backport #7852: Backport r39238 to 2.0.0Closednaruse (Yui NARUSE)02/14/2013Actions
Related to Ruby master - Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがあるCloseddrbrain (Eric Hodel)02/24/2013Actions
Actions

Also available in: Atom PDF