Project

General

Profile

Bug #11281

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

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` nil header value is the same as an empty string. 

 Thanks, 

 John

Back