Skip to content

Commit 104c210

Browse files
committed
Fix BZ 69848 - Correct copy/paste error when refactoring method names
https://bz.apache.org/bugzilla/show_bug.cgi?id=69848
1 parent 60210a9 commit 104c210

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

java/org/apache/coyote/ajp/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public final class Constants {
105105

106106
// Translates integer codes to names of HTTP methods
107107
private static final String[] methodTransArray =
108-
{ Method.OPTIONS, Method.GET, Method.HEAD, Method.POST, Method.PUT, Method.OPTIONS, Method.TRACE, Method.TRACE, Method.PROPPATCH, Method.MKCOL, Method.COPY,
108+
{ Method.OPTIONS, Method.GET, Method.HEAD, Method.POST, Method.PUT, Method.DELETE, Method.TRACE, Method.TRACE, Method.PROPPATCH, Method.MKCOL, Method.COPY,
109109
Method.MOVE, Method.LOCK, Method.UNLOCK, "ACL", "REPORT", "VERSION-CONTROL", "CHECKIN", "CHECKOUT", "UNCHECKOUT",
110110
"SEARCH", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BASELINE-CONTROL", "MKACTIVITY" };
111111

test/org/apache/catalina/realm/TestRealmBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public void testHttpConstraint() throws IOException {
660660
SecurityConstraint deleteConstraint = new SecurityConstraint();
661661
deleteConstraint.addAuthRole(ROLE1);
662662
SecurityCollection deleteCollection = new SecurityCollection();
663-
deleteCollection.addMethod(Method.OPTIONS);
663+
deleteCollection.addMethod(Method.DELETE);
664664
deleteCollection.addPatternDecoded("/*");
665665
deleteConstraint.addCollection(deleteCollection);
666666

@@ -772,7 +772,7 @@ public void testHttpConstraint() throws IOException {
772772

773773
// Only user1 should be able to perform a DELETE as only that user has
774774
// role1.
775-
request.setMethod(Method.OPTIONS);
775+
request.setMethod(Method.DELETE);
776776

777777
SecurityConstraint[] constraintsDelete =
778778
mapRealm.findSecurityConstraints(request, context);

webapps/docs/changelog.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@
241241
<bug>69836</bug>: Incorrect processing of partitioned setting when
242242
generating session cookie. Patch submitted by Marc Pynaert. (remm)
243243
</fix>
244+
<fix>
245+
<bug>69848</bug>: Fix copy/paste error that meant DELETE requests
246+
received via the AJP connector were processed as OPTIONS requests.
247+
(markt)
248+
</fix>
244249
</changelog>
245250
</subsection>
246251
<subsection name="Jasper">

0 commit comments

Comments
 (0)