From 48330ef457b97a358fc8efc65385c804518608b2 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 8 Nov 2007 15:59:34 +0000 Subject: [PATCH] [MRM-440] If webdav URL lacks a trailing /, navigating to all links in the listing return 404. Fixed by redirecting to proper url in the situation of a GET request on an existing directory. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@593215 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/web/repository/ProxiedDavServer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java index 998652618..69dca5d1a 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java @@ -146,8 +146,15 @@ public class ProxiedDavServer // If this a directory resource, then we are likely browsing. if ( resourceFile.exists() && resourceFile.isDirectory() ) { - // TODO: [MRM-440] - If webdav URL lacks a trailing /, navigating to all links in the listing return 404. - // TODO: Issue redirect with proper pathing. + String requestURL = request.getRequest().getRequestURL().toString(); + + // [MRM-440] - If webdav URL lacks a trailing /, navigating to all links in the listing return 404. + if( !requestURL.endsWith( "/" ) ) + { + String redirectToLocation = requestURL + "/"; + response.sendRedirect( redirectToLocation ); + return; + } // Process the request. davServer.process( request, response ); -- 2.39.5