mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/http.rb (Net::HTTP.start): options may not be given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0d354933c5
commit
3b42acc8c1
2 changed files with 12 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Jan 12 16:48:46 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/net/http.rb (Net::HTTP.start): options may not be given.
|
||||||
|
|
||||||
Tue Jan 12 16:48:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Jan 12 16:48:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/readline/readline.c (readline_readline): check if instream
|
* ext/readline/readline.c (readline_readline): check if instream
|
||||||
|
|
|
@ -471,14 +471,16 @@ module Net #:nodoc:
|
||||||
def HTTP.start(address, *arg, &block) # :yield: +http+
|
def HTTP.start(address, *arg, &block) # :yield: +http+
|
||||||
arg.pop if opt = Hash.try_convert(arg[-1])
|
arg.pop if opt = Hash.try_convert(arg[-1])
|
||||||
port, p_addr, p_port, p_user, p_pass = *arg
|
port, p_addr, p_port, p_user, p_pass = *arg
|
||||||
port = https_default_port if opt[:use_ssl] && !port
|
port = https_default_port if !port && opt && opt[:use_ssl]
|
||||||
http = new(address, port, p_addr, p_port, p_user, p_pass)
|
http = new(address, port, p_addr, p_port, p_user, p_pass)
|
||||||
|
|
||||||
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt) if opt[:use_ssl]
|
if opt
|
||||||
http.methods.grep(/\A(\w+)=\z/) do |meth|
|
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt) if opt[:use_ssl]
|
||||||
key = $1.to_sym
|
http.methods.grep(/\A(\w+)=\z/) do |meth|
|
||||||
opt.key?(key) or next
|
key = $1.to_sym
|
||||||
http.__send__(meth, opt[key])
|
opt.key?(key) or next
|
||||||
|
http.__send__(meth, opt[key])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
http.start(&block)
|
http.start(&block)
|
||||||
|
|
Loading…
Reference in a new issue