mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/uri/generic.rb (module URI): URI now downcases the scheme to
follow RFC 2396 section 3.1. [ruby-trunk - Feature #4551] * test/uri/test_generic.rb (class URI): Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ea9b6997cc
commit
655738577f
3 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Apr 12 07:10:37 2012 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/uri/generic.rb (module URI): URI now downcases the scheme to
|
||||
follow RFC 2396 section 3.1. [ruby-trunk - Feature #4551]
|
||||
* test/uri/test_generic.rb (class URI): Test for above
|
||||
|
||||
Thu Apr 12 06:15:44 2012 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/net/protocol.rb (module Net): Added ReadTimeout to match
|
||||
|
|
|
@ -339,7 +339,7 @@ module URI
|
|||
# see also URI::Generic.scheme=
|
||||
#
|
||||
def set_scheme(v)
|
||||
@scheme = v
|
||||
@scheme = v ? v.downcase : v
|
||||
end
|
||||
protected :set_scheme
|
||||
|
||||
|
|
|
@ -708,6 +708,12 @@ class URI::TestGeneric < Test::Unit::TestCase
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue