On Mon, 2006-06-19 at 15:51 +0200, Carsten Ziegeler wrote: > Andreas Hartmann wrote: > >>> > >>> <map:match pattern="*/"> > >>> <map:redirect-to uri="introduction.html"/> > >>> </map:match> > >>> > >>> After the change, this matches all URLs ending with a slash, > >>> even ones containing slashes. This is not intended, is it? > >>> > >> No, it's definitly not. This is a bug, I'll add your test case. > > > > OK, thanks a lot! > > > Ok, I fixed this one, but I'm getting more and more unhappy with the > code; perhaps a clean rewrite would help...
Thanks for the fix! But somehow there still seems to be a problem with "*/" matching more than it should. If I change the URL in the testcase from "foo/bar/" to "test/foo/bar/", it matches "*/" and the testcase fails. (See attached diff) Is this another bug or did I miss something? Josias > > Carsten >
Index: src/test/org/apache/cocoon/util/test/WildcardHelperTestCase.java =================================================================== --- src/test/org/apache/cocoon/util/test/WildcardHelperTestCase.java (revision 415571) +++ src/test/org/apache/cocoon/util/test/WildcardHelperTestCase.java (working copy) @@ -102,6 +102,9 @@ boolean result = WildcardHelper.match(resultMap, "foo/bar/", expr); assertFalse("Url 'foo/bar/' should not match pattern '*/'.", result); + result = WildcardHelper.match(resultMap, "test/foo/bar/", expr); + assertFalse("Url 'test/foo/bar/' should not match pattern '*/'.", result); + result = WildcardHelper.match(resultMap, "foo/", expr); assertTrue("Url 'foo/' should match pattern '*/'", result); }