[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

[ruby-core:70410] [Ruby trunk - Bug #11285] Net::HTTP should handle content-coding with case-insensitive

From: usa@...
Date: 2015-08-17 07:50:07 UTC
List: ruby-core #70410
Issue #11285 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

ruby_2_1 r51602 merged revision(s) 51061,51063,51091.

----------------------------------------
Bug #11285: Net::HTTP should handle content-coding with case-insensitive 
https://bugs.ruby-lang.org/issues/11285#change-53816

* Author: Andy Chu
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
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/

In This Thread

Prev Next