summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-05 09:56:34 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-05 09:56:34 +0000
commit661268aba73f0c7669115f88c7bdcd6524cc882d (patch)
treeec415070e12d3071d7f5dd32ed1b8a49914444a1 /lib
parentc44118b8a0dad1cef18f3294e15f15509e66e9e8 (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb16
-rw-r--r--lib/net/https.rb8
2 files changed, 15 insertions, 9 deletions
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,