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

markt 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 104c210b54 Fix BZ 69848 - Correct copy/paste error when refactoring 
method names
104c210b54 is described below

commit 104c210b54170b9f2e94ac98062e7609c8b4874a
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 10 08:48:33 2025 +0100

    Fix BZ 69848 - Correct copy/paste error when refactoring method names
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=69848
---
 java/org/apache/coyote/ajp/Constants.java         | 2 +-
 test/org/apache/catalina/realm/TestRealmBase.java | 4 ++--
 webapps/docs/changelog.xml                        | 5 +++++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/ajp/Constants.java 
b/java/org/apache/coyote/ajp/Constants.java
index 1a544763da..6549a226a8 100644
--- a/java/org/apache/coyote/ajp/Constants.java
+++ b/java/org/apache/coyote/ajp/Constants.java
@@ -105,7 +105,7 @@ public final class Constants {
 
     // Translates integer codes to names of HTTP methods
     private static final String[] methodTransArray =
-            { Method.OPTIONS, Method.GET, Method.HEAD, Method.POST, 
Method.PUT, Method.OPTIONS, Method.TRACE, Method.TRACE, Method.PROPPATCH, 
Method.MKCOL, Method.COPY,
+            { Method.OPTIONS, Method.GET, Method.HEAD, Method.POST, 
Method.PUT, Method.DELETE, Method.TRACE, Method.TRACE, Method.PROPPATCH, 
Method.MKCOL, Method.COPY,
                     Method.MOVE, Method.LOCK, Method.UNLOCK, "ACL", "REPORT", 
"VERSION-CONTROL", "CHECKIN", "CHECKOUT", "UNCHECKOUT",
                     "SEARCH", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", 
"BASELINE-CONTROL", "MKACTIVITY" };
 
diff --git a/test/org/apache/catalina/realm/TestRealmBase.java 
b/test/org/apache/catalina/realm/TestRealmBase.java
index 2776c32723..88d7ff2466 100644
--- a/test/org/apache/catalina/realm/TestRealmBase.java
+++ b/test/org/apache/catalina/realm/TestRealmBase.java
@@ -660,7 +660,7 @@ public class TestRealmBase {
         SecurityConstraint deleteConstraint = new SecurityConstraint();
         deleteConstraint.addAuthRole(ROLE1);
         SecurityCollection deleteCollection = new SecurityCollection();
-        deleteCollection.addMethod(Method.OPTIONS);
+        deleteCollection.addMethod(Method.DELETE);
         deleteCollection.addPatternDecoded("/*");
         deleteConstraint.addCollection(deleteCollection);
 
@@ -772,7 +772,7 @@ public class TestRealmBase {
 
         // Only user1 should be able to perform a DELETE as only that user has
         // role1.
-        request.setMethod(Method.OPTIONS);
+        request.setMethod(Method.DELETE);
 
         SecurityConstraint[] constraintsDelete =
                 mapRealm.findSecurityConstraints(request, context);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d47122aa3e..c5c61e18d9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -241,6 +241,11 @@
         <bug>69836</bug>: Incorrect processing of partitioned setting when
         generating session cookie. Patch submitted by Marc Pynaert. (remm)
       </fix>
+      <fix>
+        <bug>69848</bug>: Fix copy/paste error that meant DELETE requests
+        received via the AJP connector were processed as OPTIONS requests.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to