From 661268aba73f0c7669115f88c7bdcd6524cc882d Mon Sep 17 00:00:00 2001 From: aamine Date: Sun, 5 Feb 2006 09:56:34 +0000 Subject: * lib/net/http.rb: imported from trunk, rev 1.129 * lib/net/http.rb (add_field, get_fields): keep 1.8.2 backward compatibility. * lib/net/https.rb: imported from trunk, rev 1.3. * lib/net/https.rb: #use_ssl? definition moved from net/http.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/net/http.rb') diff --git a/lib/net/http.rb b/lib/net/http.rb index 98e16c9294..3f05d81073 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1,8 +1,8 @@ # # = net/http.rb # -# Copyright (c) 1999-2005 Yukihiro Matsumoto -# Copyright (c) 1999-2005 Minero Aoki +# Copyright (c) 1999-2006 Yukihiro Matsumoto +# Copyright (c) 1999-2006 Minero Aoki # Copyright (c) 2001 GOTOU Yuuzou # # Written and maintained by Minero Aoki . @@ -280,7 +280,7 @@ module Net #:nodoc: # :stopdoc: Revision = %q$Revision$.split[1] HTTPVersion = '1.1' - @newimpl = true # for backward compatability + @newimpl = true # :startdoc: # Turns on net/http 1.2 (ruby 1.8) features. @@ -523,11 +523,9 @@ module Net #:nodoc: # returns true if use SSL/TLS with HTTP. def use_ssl? - @use_ssl + false # redefined in net/https end - alias use_ssl use_ssl? #:nodoc: obsolete - # Opens TCP connection and HTTP session. # # When this method is called with block, gives a HTTP object @@ -1158,7 +1156,7 @@ module Net #:nodoc: @header.delete key.downcase return val end - @header[key.downcase] = Array(val).map {|s| s.to_str } + @header[key.downcase] = [val] end # [Ruby 1.8.3] @@ -1178,9 +1176,9 @@ module Net #:nodoc: # def add_field(key, val) if @header.key?(key.downcase) - @header[key.downcase].concat Array(val) + @header[key.downcase].concat [val] else - @header[key.downcase] = Array(val).dup + @header[key.downcase] = [val] end end -- cgit v1.2.3