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 B11F81960015 for ; Tue, 30 Jun 2015 01:09:52 +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 796CAB5D83D for ; Tue, 30 Jun 2015 01:35:03 +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 9C14B97A827 for ; Tue, 30 Jun 2015 01:35:04 +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 PG4AuNSayo5j for ; Tue, 30 Jun 2015 01:35:04 +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 290D497A820 for ; Tue, 30 Jun 2015 01:35:04 +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 B3143952439 for ; Tue, 30 Jun 2015 01:35:00 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E1720120481; Tue, 30 Jun 2015 01:34:59 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id C3972120464 for ; Tue, 30 Jun 2015 01:34:56 +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=y0jTu5JyhA1IWe0beh59TQGU0mU=; b=DYnyal/kLXbnTs/kXx RVIlXpJMjwm3xOj6Dan11GQrm3ujSiTaP9i9QV2+nYQcFofy2GnRGdt7VW5D2XJS WR4cda2jr8i2VbMUZbeQQMRTdOPNVOD/Ror4akwZybstPYZ5lmkCEeM0pKwnb3Hy 7dXW8a++H0UPEx7VS3HXN81PQ= Received: by filter0535p1mdw1.sendgrid.net with SMTP id filter0535p1mdw1.7259.559173AA3 2015-06-29 16:34:50.099752934 +0000 UTC Received: from herokuapp.com (ec2-54-157-202-63.compute-1.amazonaws.com [54.157.202.63]) by ismtpd-025 (SG) with ESMTP id 14e402bcfd5.24e2.43ccf3 for ; Mon, 29 Jun 2015 16:34:49 +0000 (UTC) Date: Mon, 29 Jun 2015 16:34:49 +0000 From: shishir127@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: 44353 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11281 X-Redmine-Issue-Author: jcarter@intellicentrics.com X-Redmine-Sender: shishir127 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6/86ELB418IgO4egw5hjPl6rRQ2md/S7bTHQ ZGAX8FI8hS2kD7j1fVH/9EPHb9Z6hC1K1qu2hkLRTSU1ABFXMiZUfkrbxTLE8osr7b86rYZb0FO3Nf 0E20Iz4imeBzQRR8mdOZk7exOQy3xRMR5Fpx X-SendGrid-Contentd-ID: {"test_id":"1435595691"} X-ML-Name: ruby-core X-Mail-Count: 69773 Subject: [ruby-core:69773] [Ruby trunk - Bug #11281] Unexpected behaviour in HTTP header processing 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 #11281 has been updated by Shishir Joshi. I think if the user wants to send a blank header, then the user should do that explicitly like so ~~~ Net::HTTP::Get.new('http://any.url', {'header' => ""}) ~~~ Converting a `nil` value to a blank string is not so obvious behaviour so I am OK with skipping `nil` values. ---------------------------------------- Bug #11281: Unexpected behaviour in HTTP header processing https://bugs.ruby-lang.org/issues/11281#change-53151 * Author: John Carter * Status: Feedback * Priority: Normal * Assignee: * ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Running this: ~~~ruby Net::HTTP::Get.new('http://any.url', {'header' => nil}) ~~~ Results in: ~~~ NoMethodError: undefined method `strip' for nil:NilClass from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http/header.rb:17:in `block in initialize_http_header' from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http/header.rb:15:in `each' from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http/header.rb:15:in `initialize_http_header' from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http/generic_request.rb:43:in `initialize' from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http/request.rb:14:in `initialize' from (irb):13:in `new' from (irb):13 ~~~ Suggest implementation changes to assume a `nil` header value is the same as an empty string. Thanks, John -- https://bugs.ruby-lang.org/