This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new b03fde0383 Make WebdavServlet properly return the Allow header on
NOT_ALLOWED status
b03fde0383 is described below
commit b03fde03837da631c69226d19d67b751f5b05919
Author: Michael Osipov <[email protected]>
AuthorDate: Wed Oct 2 13:48:45 2024 +0200
Make WebdavServlet properly return the Allow header on NOT_ALLOWED status
---
java/org/apache/catalina/servlets/WebdavServlet.java | 2 +-
webapps/docs/changelog.xml | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/servlets/WebdavServlet.java
b/java/org/apache/catalina/servlets/WebdavServlet.java
index a392d729d5..455727ef63 100644
--- a/java/org/apache/catalina/servlets/WebdavServlet.java
+++ b/java/org/apache/catalina/servlets/WebdavServlet.java
@@ -1695,7 +1695,7 @@ public class WebdavServlet extends DefaultServlet
implements PeriodicEventListen
if (!resource.isDirectory()) {
if (!resource.delete()) {
- resp.sendError(WebdavStatus.SC_METHOD_NOT_ALLOWED);
+ sendNotAllowed(req, resp);
return false;
}
} else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f4eb84d1b4..0ce26bd380 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -133,6 +133,10 @@
<code>WebdavServlet</code> and <code>DefaultServlet</code>.
(michaelo)
</fix>
+ <fix>
+ Make <code>WebdavServlet</code> properly return the <code>Allow</code>
+ header when deletion of a resource is not allowed. (michaelo)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]