diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-12 08:40:23 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-12 08:40:23 +0000 |
| commit | 74cdc991c0d685e56457d2cbdb5ac6c904b3fec1 (patch) | |
| tree | cadf04bab5fc5d636e1bd7e3b1423e4fe8171542 /lib | |
| parent | 7889a39f6405da016d8124dfdc77183fe660b60e (diff) | |
| download | ruby-74cdc991c0d685e56457d2cbdb5ac6c904b3fec1.tar.gz ruby-74cdc991c0d685e56457d2cbdb5ac6c904b3fec1.tar.xz ruby-74cdc991c0d685e56457d2cbdb5ac6c904b3fec1.zip | |
* lib/open-uri.rb (OpenURI.open_loop): send authentication only for
the URI directly specified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/open-uri.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index b78da5461..83bb756bb 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -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 |
