1
0
Fork 0
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:
drbrain 2012-04-11 22:11:07 +00:00
parent ea9b6997cc
commit 655738577f
3 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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)