diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib/uri/generic.rb | 2 | ||||
-rw-r--r-- | test/uri/test_generic.rb | 6 |
3 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Tue Dec 9 19:53:02 2003 akira yamada <akira@ruby-lang.org> + + * lib/uri/generic.rb (URI::Generic#route_from0): make case insensitive + for host-part. + + * test/uri/test_generic.rb (test_route): added tests for the above + change. + Tue Dec 9 14:10:48 2003 Tanaka Akira <akr@m17n.org> * io.c (rb_io_check_readable): don't call io_seek if EOF flag is set, diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 59f36ad4c3..d0eb403158 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -947,7 +947,7 @@ Object self.query, self.fragment) if rel.userinfo != oth.userinfo || - rel.host != oth.host || + rel.host.downcase != oth.host.downcase || rel.port != oth.port rel.set_port(nil) if rel.port == oth.default_port return rel, rel diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index de8094e4ba..a982d4e1cf 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -171,6 +171,12 @@ class TestGeneric < Test::Unit::TestCase url = URI.parse('http://hoge/a/b/').route_to('http://hoge/b/') assert_equal('../../b/', url.to_s) + + url = URI.parse('http://hoge/a/b/').route_to('http://HOGE/b/') + assert_equal('../../b/', url.to_s) + + url = URI.parse('http://hoge/a/b/').route_to('http://MOGE/b/') + assert_equal('//MOGE/b/', url.to_s) end def test_rfc2396_examples |