https://bz.apache.org/bugzilla/show_bug.cgi?id=69848

            Bug ID: 69848
           Summary: http method DELETE is converted to OPTIONS when
                    request is sent through Apache proxy over AJP
                    Connector
           Product: Tomcat 10
           Version: 10.1.47
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Connectors
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ------

Created attachment 40117
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=40117&action=edit
Java Servlet with http methods

### Steps to Reproduce
1. Setup Apache as frontend to Tomcat. Both Apache and tomcat are on same
domain (example: localhost)
    1.a) On Apache side enable JkMount/mod_jk module and add the following
directive in ssl.conf
         JkMount /servlet/* worker1
    1.b) update the worker.properties (worker1 config) to redirect the traffic
to Tomcat's AJP port(localhost:8888)
    1.c) update the Apache ssl port to 9999

2. Compile and deploy the attached servlet code to Tomcat
    2.a) Folder structure
        servlet/
        ├── WEB-INF/
        │   ├── web.xml
        │   └── classes/
        │       └── TestServlet.java   

3. HTTP request sent. 
   curl -k -i -v -X DELETE "https://localhost:9999/servlet/test";

4. Observed behavior
    - Servlet's doDelete method NOT called and hence did not received the
response text.
    - However, I got the 200 response code with the following header
        Allow: GET, HEAD, POST, DELETE, OPTIONS
    - I see the following in Tomcat's access log for the URI recieved.
        "OPTIONS /servlet/test HTTP/1.1"
    - Note: Same setup works perfectly with http connector.

### Expected Behavior
     - I am supposed to get the reponse text "DELETE received".

### Actual Behavior
     - When Tomcat receives the request on AJP connector, it is somehow
converting the http method DELETE to OPTIONS and forwards the request to the
servlet.
     - And then this request is being treated as preflight request.

### Additional Information
- Tomcat version: 10.1.47
- Java version: OpenJDK 17.0.16
- OS version: Suse Linux Enterprise Server - 6.4.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to