Don't throw exception on bogus absolute path (http://xxx//blah)

This commit is contained in:
Mike Primm 2011-06-30 03:16:12 +08:00 committed by mikeprimm
parent 3875486fbf
commit 00a660d019

View File

@ -27,6 +27,7 @@ public class FilesystemHandler extends FileHandler {
}
@Override
protected InputStream getFileInput(String path, HttpRequest request, HttpResponse response) {
if(path == null) return null;
path = getNormalizedPath(path); /* Resolve out relative stuff - nothing allowed above webroot */
File file = new File(root, path);
if(!file.isFile())