Project

General

Profile

Actions

Bug #12055

closed

`NET::HTTPResponse` is not deflating responses with custom `Content-Range` header

Added by ggcampinho (Glauber Campinho) about 8 years ago. Updated almost 2 years ago.

Status:
Closed
Target version:
-
[ruby-core:73710]
Tags:

Description

The RFC 7233, section 4.2 describes the the possibility of using a custom Content-Range header and not only for bytes https://tools.ietf.org/html/rfc7233#section-4.2. Although, the NET::HTTPResponse considers that Content-Range present on the response during the inflating is in bytes unit.

This issue is caused by this line https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L252. In the patch I changed it to check if the Content-Range unit is bytes and there is a test to reproduce the error.


Files

custom_content_range.patch (1.87 KB) custom_content_range.patch ggcampinho (Glauber Campinho), 02/05/2016 01:30 PM

Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #11450: HTTPHeader.content_range throws error on non-byte unitsClosedActions
Actions #1

Updated by ggcampinho (Glauber Campinho) about 8 years ago

  • File deleted (custom_content_range.patch)

Updated by ggcampinho (Glauber Campinho) almost 8 years ago

Hi! Any thoughts here?

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to naruse (Yui NARUSE)
Actions #6

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Is duplicate of Bug #11450: HTTPHeader.content_range throws error on non-byte units added
Actions #7

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

  • Description updated (diff)
Actions #8

Updated by Anonymous almost 2 years ago

  • Status changed from Assigned to Closed

Applied in changeset git|63546bfc1581d4abec2a0d846106a1c0afc0efa9.


HTTPHeader.content_range throws error on non-byte units

  • Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value
  • Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes
  • Modified initialize_http_header to match trunk

fix [Bug #11450]
fix https://github.com/ruby/ruby/pull/1018

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0