[281470] handle the case where request path == "/*" and servlet mapping uses a wildcard
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@433 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
0f854e3c84
commit
be85a6a16d
|
@ -16,6 +16,7 @@ jetty-7.0.0.M3 20 June 2009
|
|||
+ Refactored AbstractBuffers to HttpBuffers for performance
|
||||
+ Numerous cleanups from static code analysis
|
||||
+ 280707 client.HttpConnection does not catch and handle non-IOExceptions
|
||||
+ 281470 Handle the case where request.PathInfo() should be "/*"
|
||||
|
||||
jetty-7.0.0.M2 18 May 2009
|
||||
+ JETTY-937 Work around Sun JVM bugs
|
||||
|
|
|
@ -461,10 +461,13 @@ public class PathMap extends HashMap implements Externalizable
|
|||
if (pathSpec.length()==1)
|
||||
return null;
|
||||
|
||||
if (pathSpec.equals(path))
|
||||
boolean wildcard = isPathWildcardMatch(pathSpec, path);
|
||||
|
||||
// handle the case where pathSpec uses a wildcard and path info is "/*"
|
||||
if (pathSpec.equals(path) && !wildcard)
|
||||
return null;
|
||||
|
||||
if (isPathWildcardMatch(pathSpec, path))
|
||||
if (wildcard)
|
||||
{
|
||||
if (path.length()==pathSpec.length()-2)
|
||||
return null;
|
||||
|
|
|
@ -77,6 +77,8 @@ public class PathMapTest extends TestCase
|
|||
{ "/animal/insect/bug", "5"},
|
||||
{ "/animal", "5"},
|
||||
{ "/animal/", "5"},
|
||||
{ "/animal/x", "5"},
|
||||
{ "/animal/*", "5"},
|
||||
{ "/suffix/path.tar.gz", "6"},
|
||||
{ "/suffix/path.gz", "7"},
|
||||
{ "/animal/path.gz", "5"},
|
||||
|
@ -105,6 +107,7 @@ public class PathMapTest extends TestCase
|
|||
|
||||
assertEquals("pathInfo exact", null, PathMap.pathInfo("/Foo/bar", "/Foo/bar"));
|
||||
assertEquals("pathInfo prefix", "/bar", PathMap.pathInfo("/Foo/*", "/Foo/bar"));
|
||||
assertEquals("pathInfo prefix", "/*", PathMap.pathInfo("/Foo/*", "/Foo/*"));
|
||||
assertEquals("pathInfo prefix", "/", PathMap.pathInfo("/Foo/*", "/Foo/"));
|
||||
assertEquals("pathInfo prefix", null, PathMap.pathInfo("/Foo/*", "/Foo"));
|
||||
assertEquals("pathInfo suffix", null, PathMap.pathInfo("*.ext", "/Foo/bar.ext"));
|
||||
|
|
Loading…
Reference in New Issue