From: nagachika00@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:69774] [Ruby trunk - Bug #11285] Net::HTTP should handle content-coding with case-insensitive
Date: Mon, 29 Jun 2015 16:52:05 +0000 [thread overview]
Message-ID: <redmine.journal-53152.20150629165204.ead5a300fc251832@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11285.20150618233844@ruby-lang.org
Issue #11285 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
Bug #11285: Net::HTTP should handle content-coding with case-insensitive
https://bugs.ruby-lang.org/issues/11285#change-53152
* Author: Andy Chu
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
When Ruby Net::HTTP sent a request. It by default set the content to be compress with header: Accept-Encoding
But if server return with content-encoding = GZIP (or any case other then all lower case) it will not tread the body as compressed.
According to HTTP 1.1 spec, Content-Encoding should be value used by content-coding, and the value of content-coding should be case-insensitive
content-coding: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5
I think simply change the code here: https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L253
from
case self['content-encoding']
to
case self['content-encoding'].downcase
should work
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2015-06-29 16:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-11285.20150618233844@ruby-lang.org>
2015-06-18 23:38 ` [ruby-core:69670] [Ruby trunk - Bug #11285] [Open] Net::HTTP should handle content-coding with case-insensitive andy.chu
2015-06-29 16:52 ` nagachika00 [this message]
2015-06-29 16:53 ` [ruby-core:69775] [Ruby trunk - Bug #11285] " nagachika00
2015-08-10 16:47 ` [ruby-core:70314] " nagachika00
2015-08-17 7:50 ` [ruby-core:70410] " usa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-53152.20150629165204.ead5a300fc251832@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).