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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new af328f3382 Add a test for an invalid method.
af328f3382 is described below

commit af328f33825f2bd5a3bd5fe3ce788aa23ae2ec78
Author: Mark Thomas <[email protected]>
AuthorDate: Mon May 18 11:59:19 2026 +0100

    Add a test for an invalid method.
---
 .../apache/coyote/http2/TestHttp2Section_8_1.java  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/org/apache/coyote/http2/TestHttp2Section_8_1.java 
b/test/org/apache/coyote/http2/TestHttp2Section_8_1.java
index 754a5fc43a..9643411cdf 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_8_1.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_8_1.java
@@ -556,4 +556,28 @@ public class TestHttp2Section_8_1 extends Http2TestBase {
 
         doInvalidPseudoHeaderTest(headers, "3-RST-[1]\n");
     }
+
+
+    @Test
+    public void testMethodHeaderInvalid() throws Exception {
+        http2Connect();
+
+        List<Header> headers = new ArrayList<>(4);
+        headers.add(new Header(":method", "GET\r\n"));
+        headers.add(new Header(":scheme", "http"));
+        headers.add(new Header(":path", "/simple"));
+        headers.add(new Header("host", "localhost:" + getPort()));
+
+        byte[] headersFrameHeader = new byte[9];
+        ByteBuffer headersPayload = ByteBuffer.allocate(128);
+
+        buildGetRequest(headersFrameHeader, headersPayload, null, headers, 3);
+
+        writeFrame(headersFrameHeader, headersPayload);
+
+        parser.readFrame();
+
+        String trace = output.getTrace();
+        Assert.assertTrue(trace, trace.contains("3-RST-[1]"));
+    }
 }


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

Reply via email to