diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib/net/http.rb | 16 | ||||
-rw-r--r-- | lib/net/https.rb | 8 |
3 files changed, 26 insertions, 9 deletions
@@ -1,3 +1,14 @@ +Sun Feb 5 18:55:08 2006 Minero Aoki <aamine@loveruby.net> + + * 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. + Sun Feb 5 14:22:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> * lib/pstore.rb: should return default value if name is not found. 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 <aamine@loveruby.net>. @@ -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 diff --git a/lib/net/https.rb b/lib/net/https.rb index 8268c04885..e296dbbed4 100644 --- a/lib/net/https.rb +++ b/lib/net/https.rb @@ -104,6 +104,14 @@ require 'openssl' module Net class HTTP + remove_method :use_ssl? + def use_ssl? + @use_ssl + end + + # For backward compatibility. + alias use_ssl use_ssl? + # Turn on/off SSL. # This flag must be set before starting session. # If you change use_ssl value after session started, |