1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/open-uri.rb (OpenURI.open_loop): send authentication only for

the URI directly specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2005-02-12 08:40:23 +00:00
parent 4413bd95c6
commit 4c1d7f6d8f
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Sat Feb 12 17:29:19 2005 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (OpenURI.open_loop): send authentication only for
the URI directly specified.
Sat Feb 12 15:07:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* random.c (rand_init): suppress warning.

View file

@ -176,6 +176,11 @@ module OpenURI
unless OpenURI.redirectable?(uri, redirect)
raise "redirection forbidden: #{uri} -> #{redirect}"
end
if options.include? :http_basic_authentication
# send authentication only for the URI directly specified.
options = options.dup
options.delete :http_basic_authentication
end
uri = redirect
raise "HTTP redirection loop: #{uri}" if uri_set.include? uri.to_s
uri_set[uri.to_s] = true
@ -201,7 +206,8 @@ module OpenURI
raise "Non-HTTP proxy URI: #{proxy}" if proxy.class != URI::HTTP
end
if target.userinfo
if target.userinfo && "1.9.0" <= RUBY_VERSION
# don't raise for 1.8 because compatibility.
raise "userinfo not supported. [RFC3986]"
end