File tree 1 file changed +16
-0
lines changed
okhttp/third_party/okhttp/test/java/io/grpc/okhttp/internal/framed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,22 @@ private static List<Header> headerEntries(String... elements) {
92
92
assertEquals (headerEntries ("custom-key" , "custom-header" ), hpackReader .getAndResetHeaderList ());
93
93
}
94
94
95
+ @ Test public void setMaxDynamicTableToZeroDoesNotClearHeaderList () throws IOException {
96
+ bytesIn .writeByte (0x40 ); // Literal indexed
97
+ bytesIn .writeByte (0x0a ); // Literal name (len = 10)
98
+ bytesIn .writeUtf8 ("custom-key" );
99
+
100
+ bytesIn .writeByte (0x0d ); // Literal value (len = 13)
101
+ bytesIn .writeUtf8 ("custom-header" );
102
+
103
+ bytesIn .writeByte (0x20 ); // Set max table size to 0
104
+
105
+ hpackReader .readHeaders ();
106
+
107
+ assertEquals (0 , hpackReader .maxDynamicTableByteCount ());
108
+ assertEquals (headerEntries ("custom-key" , "custom-header" ), hpackReader .getAndResetHeaderList ());
109
+ }
110
+
95
111
/** Oldest entries are evicted to support newer ones. */
96
112
@ Test public void testEviction () throws IOException {
97
113
bytesIn .writeByte (0x40 ); // Literal indexed
You can’t perform that action at this time.
0 commit comments