Project

General

Profile

Actions

Bug #445

closed

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

Added by NoKarma (Arthur Schreiber) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
-
Backport:
[ruby-core:18308]

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


Files

net_httpheader_fetch.patch (477 Bytes) net_httpheader_fetch.patch NoKarma (Arthur Schreiber), 08/15/2008 09:42 PM
Actions #1

Updated by shyouhei (Shyouhei Urabe) about 15 years ago

  • Assignee set to aamine (Minero Aoki)
  • ruby -v set to -

=begin

=end

Actions #2

Updated by marcandre (Marc-Andre Lafortune) over 14 years ago

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

=begin
Applied in changeset r24912.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0