Hi! I was working in uri test cases too so i send some more cases testing abnormal examples (you can find them in the RFC) :) Most of the abnormal examples works well except two of them:
1. when the relative uri is empty > an exception is thrown (i think it is a good idea to avoid empty uris) 2. when there are more relative path ".." segments than hierarchical levels in the base uri's path (the ".." expression must not change the authority component of a uri). There are two options here: base: http://a/b/c/d;p?q relative: ../../../g option1: http://a/../g option2: http://a/g (compensating author errors) do you think this last abnormal example is important to be fixed? if true, what option do you prefer? :) (i prefer the second one) Armando -----Original Message----- From: Michael Becke [mailto:[EMAIL PROTECTED]] Sent: martes, 28 de enero de 2003 5:54 To: Commons HttpClient Project Subject: [PATCH] relative URIs - take 2 Here's the patch for part 1 (the URI constructor). Sung-Gu is correct about the second part. This functionality is already covered by getUIReference(). If anything, I think the comments could use a little more work to clear up the second issue. I'll look into that a little later. Mike
Index: TestURI.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestURI.java,v retrieving revision 1.1 diff -r1.1 TestURI.java 131a132,150 > // Abnormal examples > // { "../../../g", "http", "a", "/g", null, null, "http://a/g" }, > // { "../../../../g", "http", "a", "/g", null, null, "http://a/g" }, > { "/./g", "http", "a", "/./g", null, null, "http://a/./g" }, > { "/../g", "http", "a", "/../g", null, null, "http://a/../g" }, > { "g.", "http", "a", "/b/c/g.", null, null, "http://a/b/c/g." }, > { ".g", "http", "a", "/b/c/.g", null, null, "http://a/b/c/.g" }, > { "g..", "http", "a", "/b/c/g..", null, null, "http://a/b/c/g.." }, > { "..g", "http", "a", "/b/c/..g", null, null, "http://a/b/c/..g" }, > { "./../g", "http", "a", "/b/g", null, null, "http://a/b/g" }, > { "./g/.", "http", "a", "/b/c/g/", null, null, "http://a/b/c/g/" }, > { "g/./h", "http", "a", "/b/c/g/h", null, null, "http://a/b/c/g/h" }, > { "g/../h", "http", "a", "/b/c/h", null, null, "http://a/b/c/h" }, > { "g;x=1/./y", "http", "a", "/b/c/g;x=1/y", null, null, >"http://a/b/c/g;x=1/y" }, > { "g;x=1/../y", "http", "a", "/b/c/y", null, null, "http://a/b/c/y" }, > { "g?y/./x", "http", "a", "/b/c/g", "y/./x", null, >"http://a/b/c/g?y/./x" }, > { "g?y/../x", "http", "a", "/b/c/g", "y/../x", null, >"http://a/b/c/g?y/../x" }, > { "g#s/./x", "http", "a", "/b/c/g", null, "s/./x", >"http://a/b/c/g#s/./x" }, > { "g#s/../x", "http", "a", "/b/c/g", null, "s/../x", >"http://a/b/c/g#s/../x" } 133d151 <
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>