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>
|
||||
|
||||
* lib/pstore.rb: should return default value if name is not found.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue