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 2fe2fb326c Add a test for an invalid method.
2fe2fb326c is described below
commit 2fe2fb326c79a1d3e1b480de55c88f04b8083f90
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]