Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2015-04-29 23:06:01 +0000
committerJan Bartel2015-04-29 23:06:01 +0000
commit25474ff7ab41a93d3c89de7ddc3f04b384c51762 (patch)
treef63c6600a4802f6bc822fb3edabdad3a6274baf8
parentd7de34af764e61de6e3b87ef626e5a27880d8d16 (diff)
downloadorg.eclipse.jetty.project-25474ff7ab41a93d3c89de7ddc3f04b384c51762.tar.gz
org.eclipse.jetty.project-25474ff7ab41a93d3c89de7ddc3f04b384c51762.tar.xz
org.eclipse.jetty.project-25474ff7ab41a93d3c89de7ddc3f04b384c51762.zip
465700 NullPointerException in ResourceHandler with welcome files
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
index 2c49641362..3e7e5a078e 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
@@ -447,7 +447,9 @@ public class ResourceHandler extends HandlerWrapper
// handle directories
if (resource.isDirectory())
{
- if (!request.getPathInfo().endsWith(URIUtil.SLASH))
+ String pathInfo = request.getPathInfo();
+ boolean endsWithSlash=(pathInfo==null?request.getServletPath():pathInfo).endsWith(URIUtil.SLASH);
+ if (!endsWithSlash)
{
response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH)));
return;

Back to the top