Skip to content

Commit

Permalink
The Http2Settings max header list size setting is ignored by the conv…
Browse files Browse the repository at this point in the history
…ersion to the actual Netty settings since we only send a setting when the new value is different from the initial value. The initial value is wrong and therefore leads to obtaining the incorrect value.

fixes #4211
vietj committed Dec 21, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 927672d commit ed9db7f
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/http/Http2Settings.java
Original file line number Diff line number Diff line change
@@ -57,9 +57,9 @@ public class Http2Settings {
public static final int DEFAULT_MAX_FRAME_SIZE = 16384;

/**
* Default HTTP/2 spec value for {@link #getMaxHeaderListSize} : {@code Integer.MAX_VALUE}
* Default HTTP/2 spec value for {@link #getMaxHeaderListSize} : {@code 8192}
*/
public static final int DEFAULT_MAX_HEADER_LIST_SIZE = Integer.MAX_VALUE;
public static final int DEFAULT_MAX_HEADER_LIST_SIZE = 8192;

/**
* Default HTTP/2 spec value for {@link #getExtraSettings} : {@code null}
17 changes: 17 additions & 0 deletions src/test/java/io/vertx/core/http/Http2Test.java
Original file line number Diff line number Diff line change
@@ -503,6 +503,23 @@ public void testInitialMaxConcurrentStreamZero() throws Exception {
await();
}

@Test
public void testMaxHaderListSize() throws Exception {
server.close();
server = vertx.createHttpServer(createBaseServerOptions().setInitialSettings(new Http2Settings().setMaxHeaderListSize(Integer.MAX_VALUE)));
server.requestHandler(req -> {
req.response().end();
});
startServer(testAddress);
client.request(new RequestOptions(requestOptions).setTimeout(10000))
.compose(HttpClientRequest::send)
.onComplete(onSuccess(resp -> {
assertEquals(Integer.MAX_VALUE, resp.request().connection().remoteSettings().getMaxHeaderListSize());
testComplete();
}));
await();
}

@Test
public void testFoo() throws Exception {
waitFor(2);

0 comments on commit ed9db7f

Please sign in to comment.