Project

General

Profile

Bug #723 » http-rb-fix-crash-when-initializing-header.patch

not a beautiful, but bugfix - eveel (Dmitry A. Ustalov), 11/08/2008 06:41 PM

View differences:

net/http.rb 2008-03-15 16:55:42.000000000 +0500
return unless initheader
initheader.each do |key, value|
warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
@header[key.downcase] = [value.strip]
@header[key.downcase] = [value.to_s.strip]
end
end
......
@header.delete key.downcase
return val
end
@header[key.downcase] = [val]
@header[key.downcase] = [val.to_s]
end
# [Ruby 1.8.3]
......
#
def add_field(key, val)
if @header.key?(key.downcase)
@header[key.downcase].push val
@header[key.downcase].push val.to_s
else
@header[key.downcase] = [val]
@header[key.downcase] = [val.to_s]
end
end
(1-1/2)