diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AllowedResourceAliasChecker.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AllowedResourceAliasChecker.java index 14a7f138ae6a..4a050790046f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AllowedResourceAliasChecker.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AllowedResourceAliasChecker.java @@ -76,9 +76,6 @@ protected Path getBasePath() protected void doStart() throws Exception { _basePath = getPath(_contextHandler.getBaseResource()); - if (_basePath == null) - throw new IllegalStateException("Could not obtain base resource path"); - String[] protectedTargets = _contextHandler.getProtectedTargets(); if (protectedTargets != null) { @@ -99,6 +96,9 @@ protected void doStop() throws Exception @Override public boolean check(String uri, Resource resource) { + if (_basePath == null) + return false; + // The existence check resolves the symlinks. if (!resource.exists()) return false;