Feature #4551 ยป uri.rb.scheme_downcase.patch
| test/uri/test_generic.rb (working copy) | ||
|---|---|---|
|
assert_raise(URI::InvalidURIError) { uri.query = 'bar' }
|
||
|
end
|
||
|
def test_set_scheme
|
||
|
uri = URI.parse 'HTTP://example'
|
||
|
assert_equal 'http://example', uri.to_s
|
||
|
end
|
||
|
def test_ipv6
|
||
|
assert_equal("[::1]", URI("http://[::1]/bar/baz").host)
|
||
|
assert_equal("::1", URI("http://[::1]/bar/baz").hostname)
|
||
| lib/uri/generic.rb (working copy) | ||
|---|---|---|
|
private :check_scheme
|
||
|
def set_scheme(v)
|
||
|
@scheme = v
|
||
|
@scheme = v ? v.downcase : v
|
||
|
end
|
||
|
protected :set_scheme
|
||