aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca <ltoscano@wikimedia.org>2021-01-15 17:25:25 +0100
committerMartin Stockhammer <martin_s@apache.org>2021-01-17 18:22:50 +0100
commit9cf6baaa33822aae8d0f9dbb527573d095eba5f3 (patch)
treec559644f5e866864bb2a95084b340aeb16e5f980
parenteb05fe3ca4682103b7ecb7e234d5d9a0012247f6 (diff)
downloadarchiva-9cf6baaa33822aae8d0f9dbb527573d095eba5f3.tar.gz
archiva-9cf6baaa33822aae8d0f9dbb527573d095eba5f3.zip
Avoid Jetty's default directory listing settings in web.xml
The directory listing servlet seems not be needed for the default settings. This change explicitly sets it off in web.xml. Credis to @jobar for the original change made for Wikimedia. Git Pull Request #61 Signed-off-by: Martin Stockhammer <martin_s@apache.org>
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml13
1 files changed, 12 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
index e1ac74b03..fd5bea2d7 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
@@ -160,7 +160,18 @@
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/restServices/*</url-pattern>
</servlet-mapping>
-
+
+ <!-- Removing dir-listing from Jetty default-servlet -->
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>