Bug #445

[PATCH] Net::HTTPHeaders#fetch raises NoMethodError instead of returning default values

Added by Arthur Schreiber almost 7 years ago. Updated about 4 years ago.

[ruby-core:18308]
Status:Closed
Priority:Normal
Assignee:Minero Aoki
ruby -v:- Backport:

Description

=begin
require "net/http"

class Example
include Net::HTTPHeader

attr_accessor :body

def initialize
initialize_http_header({})
end
end

@headers = Example.new

@headers.fetch("My-Header", "bla")
=> NoMethodError: undefined method `join' for "bla":String

@headers.fetch("My-Header") { |key| "#{key}: bla" }
=> NoMethodError: undefined method `join' for "bla":String

NoMethodError: undefined method `join' for "my-header: bla":String

The attached Patch fixes this issue.
=end

net_httpheader_fetch.patch Magnifier (477 Bytes) Arthur Schreiber, 08/15/2008 09:42 PM

History

#1 Updated by Shyouhei Urabe over 6 years ago

  • Assignee set to Minero Aoki
  • ruby -v set to -

=begin

=end

#2 Updated by Marc-Andre Lafortune over 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24912.
=end

Also available in: Atom PDF