You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2021/01/17 17:20:10 UTC

[archiva] branch master updated: Avoid Jetty's default directory listing settings in web.xml

This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git


The following commit(s) were added to refs/heads/master by this push:
     new 09ada16  Avoid Jetty's default directory listing settings in web.xml
09ada16 is described below

commit 09ada1604274d54efef155205e20f344361418f0
Author: Luca <lt...@wikimedia.org>
AuthorDate: Fri Jan 15 17:25:25 2021 +0100

    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 <ma...@apache.org>
---
 .../archiva-webapp/src/main/webapp/WEB-INF/web.xml          | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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 fa04fc6..4db7ae5 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
@@ -161,7 +161,18 @@
     <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>