summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 11:07:36 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 11:07:36 +0000
commit8edab1a9b47f91ac5b26844ac2890c9eaf163eec (patch)
tree742f1a17afeddb9750b9cc5ed02cb8c7d271792d
parent1c09059ed85227d8feeab11f38e64e4cd506a1d8 (diff)
make case insensitive for host-part.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--lib/uri/generic.rb2
-rw-r--r--test/uri/test_generic.rb6
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ef0c2754c..673a387e6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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