diff --git a/src/main/java/io/vertx/core/http/Http2Settings.java b/src/main/java/io/vertx/core/http/Http2Settings.java index 5ce4a7ea66b..da632482ddc 100644 --- a/src/main/java/io/vertx/core/http/Http2Settings.java +++ b/src/main/java/io/vertx/core/http/Http2Settings.java @@ -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} diff --git a/src/test/java/io/vertx/core/http/Http2Test.java b/src/test/java/io/vertx/core/http/Http2Test.java index 7f783f9a19c..9ddfbdef10a 100644 --- a/src/test/java/io/vertx/core/http/Http2Test.java +++ b/src/test/java/io/vertx/core/http/Http2Test.java @@ -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);