HADOOP-15903. Allow HttpServer2 to discover resources in /static when symlinks are used. Contributed by Inigo Goiri.

This commit is contained in:
Giovanni Matteo Fumarola 2018-11-08 14:52:24 -08:00
parent 31614bcc7c
commit 89b49167a5
1 changed files with 3 additions and 0 deletions

View File

@ -84,6 +84,7 @@ import org.eclipse.jetty.server.Server;
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 @@ public final class HttpServer2 implements FilterContainer {
asm.getSessionCookieConfig().setSecure(true);
}
logContext.setSessionHandler(handler);
logContext.addAliasCheck(new AllowSymLinkAliasChecker());
setContextAttributes(logContext, conf);
addNoCacheFilter(logContext);
defaultContexts.put(logContext, true);
@ -747,6 +749,7 @@ public final class HttpServer2 implements FilterContainer {
asm.getSessionCookieConfig().setSecure(true);
}
staticContext.setSessionHandler(handler);
staticContext.addAliasCheck(new AllowSymLinkAliasChecker());
setContextAttributes(staticContext, conf);
defaultContexts.put(staticContext, true);
}