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

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


The following commit(s) were added to refs/heads/main by this push:
     new 2547c9221f Test HTTP/2 handling of undefined flags (#1105)
2547c9221f is described below

commit 2547c9221fe987f13c5e51cfd7c32843159c5137
Author: sainadh777 <[email protected]>
AuthorDate: Wed Nov 4 02:05:50 2026 -0800

    Test HTTP/2 handling of undefined flags (#1105)
---
 TODO.md                                              |  3 +--
 .../apache/coyote/http2/TestHttp2Section_4_1.java    | 20 +++++++++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/TODO.md b/TODO.md
index 2c59b2afb3..101fa15a2f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -853,12 +853,11 @@ These are bugs, correctness issues, or missing 
functionality that may affect pro
 
 ## Test Code TODOs
 
-### 79. HTTP/2 Test Coverage (8 items)
+### 79. HTTP/2 Test Coverage (7 items)
 
 | # | File:Line | Description | Fix Idea | Effort | Difficulty |
 |---|-----------|-------------|----------|--------|------------|
 | 79.1 | `TestHttp2Section_4_1.java:32` | Tests for over-sized frames missing 
| Add tests that send frames exceeding `MAX_FRAME_SIZE` and verify 
GOAWAY/RST_STREAM. | 1-2 days | Medium |
-| 79.2 | `TestHttp2Section_4_1.java:46` | Tests for unexpected flags missing | 
Add tests for frames with invalid flag combinations. | 1-2 days | Medium |
 | 79.3 | `TestHttp2Section_3_2.java:33` | Initial request body size tests 
missing | Add tests with various body sizes (0, small, large, exceeding initial 
window). | 1-2 days | Medium |
 | 79.4 | `TestHttp2Section_6_9.java:67` | Flow control window change 
accounting tests missing | Add tests that verify window size updates are always 
accounted for, even for ignored frames. | 1-2 days | Medium |
 | 79.5 | `TestHttp2Section_6_8.java:157` | PUSH_PROMISE header/window 
processing tests missing | Add tests for PUSH_PROMISE frames that verify 
headers and window size are processed even when stream is ignored. | 1-2 days | 
Medium |
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_4_1.java 
b/test/org/apache/coyote/http2/TestHttp2Section_4_1.java
index 35872befac..a2da8669a9 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_4_1.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_4_1.java
@@ -43,7 +43,25 @@ public class TestHttp2Section_4_1 extends Http2TestBase {
     }
 
 
-    // TODO: Tests for unexpected flags. Better located in tests for section 6?
+    @Test
+    public void testUnknownFlagsIgnored() throws Exception {
+        // HTTP2 upgrade
+        http2Connect();
+
+        // Build the simple request
+        byte[] frameHeader = new byte[9];
+        ByteBuffer headersPayload = ByteBuffer.allocate(128);
+        buildSimpleGetRequest(frameHeader, headersPayload, null, 3);
+
+        // Set an undefined flag
+        frameHeader[4] = (byte) (frameHeader[4] | 0x02);
+
+        // Process the request
+        writeFrame(frameHeader, headersPayload);
+
+        readSimpleGetResponse();
+        Assert.assertEquals(getSimpleResponseTrace(3), output.getTrace());
+    }
 
 
     @Test


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

Reply via email to