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:
Greg Wilkins 2013-07-25 11:01:23 +10:00
parent ab7268e516
commit 2f08ba2948
1 changed files with 4 additions and 4 deletions

View File

@ -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);