зеркало из https://github.com/github/ruby.git
* lib/open-uri.rb (OpenURI.open_http): rescue URI::InvalidURIError by
URI.parse for location URI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ef816db96f
Коммит
54b455190b
|
@ -1,3 +1,8 @@
|
|||
Fri Feb 8 22:10:36 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/open-uri.rb (OpenURI.open_http): rescue URI::InvalidURIError by
|
||||
URI.parse for location URI.
|
||||
|
||||
Fri Feb 8 19:22:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/iconv/iconv.c (rb_str_derive): uses rb_str_subseq() for byte
|
||||
|
|
|
@ -330,7 +330,12 @@ module OpenURI
|
|||
Net::HTTPFound, # 302
|
||||
Net::HTTPSeeOther, # 303
|
||||
Net::HTTPTemporaryRedirect # 307
|
||||
throw :open_uri_redirect, URI.parse(resp['location'])
|
||||
begin
|
||||
loc_uri = URI.parse(resp['location'])
|
||||
rescue URI::InvalidURIError
|
||||
raise OpenURI::HTTPError.new(io.status.join(' ') + ' (Invalid Location URI)', io)
|
||||
end
|
||||
throw :open_uri_redirect, loc_uri
|
||||
else
|
||||
raise OpenURI::HTTPError.new(io.status.join(' '), io)
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче