mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c44118b8a0
commit
661268aba7
3 changed files with 26 additions and 9 deletions
11
ChangeLog
11
ChangeLog
|
@ -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>
|
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.
|
* lib/pstore.rb: should return default value if name is not found.
|
||||||
|
|
|
@ -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>.
|
||||||
|
@ -280,7 +280,7 @@ module Net #:nodoc:
|
||||||
# :stopdoc:
|
# :stopdoc:
|
||||||
Revision = %q$Revision$.split[1]
|
Revision = %q$Revision$.split[1]
|
||||||
HTTPVersion = '1.1'
|
HTTPVersion = '1.1'
|
||||||
@newimpl = true # for backward compatability
|
@newimpl = true
|
||||||
# :startdoc:
|
# :startdoc:
|
||||||
|
|
||||||
# Turns on net/http 1.2 (ruby 1.8) features.
|
# 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.
|
# returns true if use SSL/TLS with HTTP.
|
||||||
def use_ssl?
|
def use_ssl?
|
||||||
@use_ssl
|
false # redefined in net/https
|
||||||
end
|
end
|
||||||
|
|
||||||
alias use_ssl use_ssl? #:nodoc: obsolete
|
|
||||||
|
|
||||||
# Opens TCP connection and HTTP session.
|
# Opens TCP connection and HTTP session.
|
||||||
#
|
#
|
||||||
# When this method is called with block, gives a HTTP object
|
# When this method is called with block, gives a HTTP object
|
||||||
|
@ -1158,7 +1156,7 @@ 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]
|
# [Ruby 1.8.3]
|
||||||
|
@ -1178,9 +1176,9 @@ 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
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,14 @@ require 'openssl'
|
||||||
module Net
|
module Net
|
||||||
|
|
||||||
class HTTP
|
class HTTP
|
||||||
|
remove_method :use_ssl?
|
||||||
|
def use_ssl?
|
||||||
|
@use_ssl
|
||||||
|
end
|
||||||
|
|
||||||
|
# For backward compatibility.
|
||||||
|
alias use_ssl use_ssl?
|
||||||
|
|
||||||
# Turn on/off SSL.
|
# Turn on/off SSL.
|
||||||
# This flag must be set before starting session.
|
# This flag must be set before starting session.
|
||||||
# If you change use_ssl value after session started,
|
# If you change use_ssl value after session started,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue