413684 - Trailing slash shows JSP source
Fixed alias checkers. Non existent directory does check for none existence. Prefix and Suffix check look for none empty/trivial prefix/suffixes
This commit is contained in:
parent
ab7268e516
commit
2f08ba2948
|
@ -2191,7 +2191,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
if (dot<0)
|
||||
return false;
|
||||
String suffix=path.substring(dot);
|
||||
return resource.getAlias().toString().endsWith(suffix);
|
||||
return resource.toString().endsWith(suffix);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2206,10 +2206,10 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
public boolean check(String path, Resource resource)
|
||||
{
|
||||
int slash = path.lastIndexOf('/');
|
||||
if (slash<0)
|
||||
if (slash<0 || slash==path.length()-1)
|
||||
return false;
|
||||
String suffix=path.substring(slash);
|
||||
return resource.getAlias().toString().endsWith(suffix);
|
||||
return resource.toString().endsWith(suffix);
|
||||
}
|
||||
}
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -2222,7 +2222,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server.
|
|||
public boolean check(String path, Resource resource)
|
||||
{
|
||||
int slash = path.lastIndexOf('/');
|
||||
if (slash<0)
|
||||
if (slash<0 || resource.exists())
|
||||
return false;
|
||||
String suffix=path.substring(slash);
|
||||
return resource.getAlias().toString().endsWith(suffix);
|
||||
|
|
Loading…
Reference in New Issue