Project

General

Profile

Backport #8645

URI#find_proxy failure if scheme is nil

Added by Daniel Berger about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:56045]

Description

If the URI scheme is not present after a URI.parse call, the call to URI#find_proxy fails.

require 'uri'
u = URI.parse("ruby-lang.org")
u.find_proxy

The result is:

c:/ruby2/lib/ruby/2.0.0/uri/generic.rb:1614:in find_proxy': undefined methoddowncase' for nil:NilClass (NoMethodError)

This actually happens in 1.9.x as well.

I'm not sure what it should return in this case, but it shouldn't raise that error.

Associated revisions

Revision 42153
Added by Yui NARUSE about 3 years ago

  • lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is a relative URI. [Bug #8645]

Revision 42153
Added by Yui NARUSE about 3 years ago

  • lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is a relative URI. [Bug #8645]

Revision 42155
Added by Tomoyuki Chikanaga about 3 years ago

merge revision(s) 42153: [Backport #8645]

* lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is
  a relative URI. [Bug #8645]

History

#1 Updated by Yui NARUSE about 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42153.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is a relative URI. [Bug #8645]

#2 Updated by Tomoyuki Chikanaga about 3 years ago

  • Tracker changed from Bug to Backport
  • Assignee set to Tomoyuki Chikanaga
  • Project changed from Ruby trunk to Backport200
  • Status changed from Closed to Assigned

#3 Updated by Tomoyuki Chikanaga about 3 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r42155.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42153: [Backport #8645]

* lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is
  a relative URI. [Bug #8645]

Also available in: Atom PDF