]> source.dussan.org Git - archiva.git/commitdiff
Avoid Jetty's default directory listing settings in web.xml
authorLuca <ltoscano@wikimedia.org>
Fri, 15 Jan 2021 16:25:25 +0000 (17:25 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 17 Jan 2021 16:11:19 +0000 (17:11 +0100)
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>
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml

index fa04fc60537da079b9f91692224f3891a9328fe8..4db7ae5356215d1a5ddba3daef50ed9b9e8b603d 100644 (file)
     <servlet-name>CXFServletV2</servlet-name>
     <url-pattern>/api/*</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>