* lib/net/http.rb (add_field, get_fields): keep 1.8.2 compatibility. This patch is contributed by Rob Pitt.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
13d62dfa79
commit
0ff14af9fa
@ -1,3 +1,8 @@
|
|||||||
|
Sun Feb 5 18:49:00 2006 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* lib/net/http.rb (add_field, get_fields): keep 1.8.2
|
||||||
|
compatibility. This patch is contributed by Rob Pitt.
|
||||||
|
|
||||||
Sun Feb 5 16:33:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
Sun Feb 5 16:33:50 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
* lib/mkmf.rb (create_makefile): Kernel#sub! was removed on HEAD.
|
* lib/mkmf.rb (create_makefile): Kernel#sub! was removed on HEAD.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#
|
#
|
||||||
# = net/http.rb
|
# = net/http.rb
|
||||||
#
|
#
|
||||||
# Copyright (c) 1999-2005 Yukihiro Matsumoto
|
# Copyright (c) 1999-2006 Yukihiro Matsumoto
|
||||||
# Copyright (c) 1999-2005 Minero Aoki
|
# Copyright (c) 1999-2006 Minero Aoki
|
||||||
# Copyright (c) 2001 GOTOU Yuuzou
|
# Copyright (c) 2001 GOTOU Yuuzou
|
||||||
#
|
#
|
||||||
# Written and maintained by Minero Aoki <aamine@loveruby.net>.
|
# Written and maintained by Minero Aoki <aamine@loveruby.net>.
|
||||||
@ -1156,9 +1156,10 @@ module Net #:nodoc:
|
|||||||
@header.delete key.downcase
|
@header.delete key.downcase
|
||||||
return val
|
return val
|
||||||
end
|
end
|
||||||
@header[key.downcase] = Array(val).map {|s| s.to_str }
|
@header[key.downcase] = [val]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# [Ruby 1.8.3]
|
||||||
# Adds header field instead of replace.
|
# Adds header field instead of replace.
|
||||||
# Second argument +val+ must be a String.
|
# Second argument +val+ must be a String.
|
||||||
# See also #[]=, #[] and #get_fields.
|
# See also #[]=, #[] and #get_fields.
|
||||||
@ -1175,12 +1176,13 @@ module Net #:nodoc:
|
|||||||
#
|
#
|
||||||
def add_field(key, val)
|
def add_field(key, val)
|
||||||
if @header.key?(key.downcase)
|
if @header.key?(key.downcase)
|
||||||
@header[key.downcase].concat Array(val)
|
@header[key.downcase].concat [val]
|
||||||
else
|
else
|
||||||
@header[key.downcase] = Array(val).dup
|
@header[key.downcase] = [val]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# [Ruby 1.8.3]
|
||||||
# Returns an array of header field strings corresponding to the
|
# Returns an array of header field strings corresponding to the
|
||||||
# case-insensitive +key+. This method allows you to get duplicated
|
# case-insensitive +key+. This method allows you to get duplicated
|
||||||
# header fields without any processing. See also #[].
|
# header fields without any processing. See also #[].
|
||||||
|
Loading…
x
Reference in New Issue
Block a user