You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2024/10/22 10:13:15 UTC
(tomcat) 08/18: Fix directory listings
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 46677e0c06640fd1abce144d539be533050d703b
Author: remm <re...@apache.org>
AuthorDate: Mon Oct 21 13:25:55 2024 +0200
Fix directory listings
---
java/org/apache/catalina/servlets/WebdavServlet.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java b/java/org/apache/catalina/servlets/WebdavServlet.java
index 1c10db5e4a..9a19960b2c 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -529,6 +529,8 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
* normal viewing.
*
* @param request The servlet request we are processing
+ * @param allowEmptyPath Used only to identify a call from DefaultServlet, to avoid removing the trailing slash
+ * @return the relative path
*/
@Override
protected String getRelativePath(HttpServletRequest request, boolean allowEmptyPath) {
@@ -549,7 +551,7 @@ public class WebdavServlet extends DefaultServlet implements PeriodicEventListen
result.append('/');
}
String resultString = result.toString();
- if (resultString.length() > 1 && resultString.endsWith("/")) {
+ if (!allowEmptyPath && resultString.length() > 1 && resultString.endsWith("/")) {
resultString = resultString.substring(0, resultString.length() - 1);
}
return resultString;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org