From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 7D00319802DC for ; Tue, 11 Aug 2015 01:13:32 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 158ADB5D864 for ; Tue, 11 Aug 2015 01:47:47 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 3DA0D97A832 for ; Tue, 11 Aug 2015 01:47:48 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eFaWA49xlUdJ for ; Tue, 11 Aug 2015 01:47:48 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id F1A8797A827 for ; Tue, 11 Aug 2015 01:47:47 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id B6AA395241E for ; Tue, 11 Aug 2015 01:47:44 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F319E120588; Tue, 11 Aug 2015 01:47:44 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 67A0312056F for ; Tue, 11 Aug 2015 01:47:40 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=/Ddd9qdcBrbBdHzPIXgO0JxROwQ=; b=YrecvSaskZWIXk09T5 +gNWT+GZfAjOG+RpOc2bNt+iNWBny/7+sVp4MGKAEy3RoG/6lTdwtvRrHEw+YRVI Gs3MO8lZ63sJIszZV4JBLpNVZ8s5RnNs71rxOoYd6HbzlT7+zdqznhEjMPbGjxXB b61bow/aGtOZtp0PmAOpciq4c= Received: by filter0591p1mdw1.sendgrid.net with SMTP id filter0591p1mdw1.22029.55C8D5A78 2015-08-10 16:47:35.179708508 +0000 UTC Received: from herokuapp.com (ec2-54-158-248-143.compute-1.amazonaws.com [54.158.248.143]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id EYQzkTQaR0uF99WpeR2LfQ for ; Mon, 10 Aug 2015 16:47:35 +0000 (UTC) Date: Mon, 10 Aug 2015 16:47:35 +0000 From: nagachika00@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 44926 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11285 X-Redmine-Issue-Author: littlechu X-Redmine-Sender: nagachika X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5Vxw3fzJO6ONPxQL64YvxlUe/n1wkeZrraBo LQ+kNZX6q8UVVa/oNen8xOvrk0LIE3gmW4W7IVpqaefM72sL07Uf4eBsElj+DYlo8XNnpcZaWR0xfs PewdinbiIzG+fDISnNfEdJsYLxsJQzi/yDuB X-ML-Name: ruby-core X-Mail-Count: 70314 Subject: [ruby-core:70314] [Ruby trunk - Bug #11285] Net::HTTP should handle content-coding with case-insensitive X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11285 has been updated by Tomoyuki Chikanaga. Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE r51061, r51063 and r51091 were backported into `ruby_2_2` branch at r51522. ---------------------------------------- Bug #11285: Net::HTTP should handle content-coding with case-insensitive https://bugs.ruby-lang.org/issues/11285#change-53736 * Author: Andy Chu * Status: Closed * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 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/