diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java index a9c23198e1..598d3ee146 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java @@ -84,6 +84,7 @@ import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SessionManager; import org.eclipse.jetty.server.SslConnectionFactory; +import org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.RequestLogHandler; @@ -725,6 +726,7 @@ protected void addDefaultApps(ContextHandlerCollection parent, asm.getSessionCookieConfig().setSecure(true); } logContext.setSessionHandler(handler); + logContext.addAliasCheck(new AllowSymLinkAliasChecker()); setContextAttributes(logContext, conf); addNoCacheFilter(logContext); defaultContexts.put(logContext, true); @@ -747,6 +749,7 @@ protected void addDefaultApps(ContextHandlerCollection parent, asm.getSessionCookieConfig().setSecure(true); } staticContext.setSessionHandler(handler); + staticContext.addAliasCheck(new AllowSymLinkAliasChecker()); setContextAttributes(staticContext, conf); defaultContexts.put(staticContext, true); }