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

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 4e0a92ad45 Add tests for OPTIONS behaviour
4e0a92ad45 is described below

commit 4e0a92ad456182b7a959bb828d8c580398b0e6bc
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 23 19:56:45 2026 +0100

    Add tests for OPTIONS behaviour
    
    Co-authored by: Claude / Sonnet 5.5
---
 test/jakarta/servlet/http/TestHttpServlet.java | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/jakarta/servlet/http/TestHttpServlet.java 
b/test/jakarta/servlet/http/TestHttpServlet.java
index b5568f5e39..c0ec0a0440 100644
--- a/test/jakarta/servlet/http/TestHttpServlet.java
+++ b/test/jakarta/servlet/http/TestHttpServlet.java
@@ -237,6 +237,15 @@ public class TestHttpServlet extends TomcatBaseTest {
     }
 
 
+    /*
+     * An Allow header set by the application before the default doPut() 
implementation is called must not be replaced.
+     */
+    @Test
+    public void testMethodNotAllowedExistingAllow() throws Exception {
+        doTestMethodNotAllowed(new AllowServlet(), "FOO");
+    }
+
+
     private void doTestDoOptions(Servlet servlet, String expectedAllow) throws 
Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -629,4 +638,16 @@ public class TestHttpServlet extends TomcatBaseTest {
             doGet(req, resp);
         }
     }
+
+
+    private static class AllowServlet extends HttpServlet {
+
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        protected void doPut(HttpServletRequest req, HttpServletResponse resp) 
throws ServletException, IOException {
+            resp.setHeader("Allow", "FOO");
+            super.doPut(req, resp);
+        }
+    }
 }


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

Reply via email to