ARTREMIS-1703 disable listing in web console

This commit is contained in:
Stanislav Knot 2018-02-26 17:49:25 +01:00 committed by Michael Andre Pearce
parent 7596f0c192
commit 5144fbb24c
3 changed files with 14 additions and 1 deletions

View File

@ -48,6 +48,12 @@
<param-value>${plugin-scripts}</param-value>
</context-param>
<context-param>
<description>Disable listing of directories and files</description>
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>org.apache.activemq.hawtio.branding.PluginContextListener</listener-class>
</listener>

View File

@ -48,6 +48,12 @@
<param-value>${plugin-scripts}</param-value>
</context-param>
<context-param>
<description>Disable listing of directories and files</description>
<param-name>org.eclipse.jetty.servlet.Default.dirAllowed</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>org.apache.activemq.hawtio.plugin.PluginContextListener</listener-class>
</listener>

View File

@ -110,7 +110,7 @@ public class WebServerComponent implements ExternalComponent {
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase(warDir.toString());
resourceHandler.setDirectoriesListed(true);
resourceHandler.setDirectoriesListed(false);
resourceHandler.setWelcomeFiles(new String[]{"index.html"});
DefaultHandler defaultHandler = new DefaultHandler();
@ -120,6 +120,7 @@ public class WebServerComponent implements ExternalComponent {
context.setContextPath("/");
context.setResourceBase(warDir.toString());
context.setHandler(resourceHandler);
context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
handlers.addHandler(context);
handlers.addHandler(defaultHandler);