diff --git a/docs/config/io_helidon_webserver_SocketConfiguration.adoc b/docs/config/io_helidon_webserver_SocketConfiguration.adoc index b84724aa634..b6dd1f4f3c6 100644 --- a/docs/config/io_helidon_webserver_SocketConfiguration.adoc +++ b/docs/config/io_helidon_webserver_SocketConfiguration.adoc @@ -62,7 +62,7 @@ Type: link:{javadoc-base-url}/io.helidon.webserver/io/helidon/webserver/SocketCo Default is `false` |`host` |string |{nbsp} |A helper method that just calls #bindAddress(String). -|`max-header-size` |int |`8192` |Maximal number of bytes of all header values combined. When a bigger value is received, a +|`max-header-size` |int |`16384` |Maximal number of bytes of all header values combined. When a bigger value is received, a io.helidon.common.http.Http.Status#BAD_REQUEST_400 is returned. diff --git a/docs/config/io_helidon_webserver_SocketConfiguration_SocketConfigurationBuilder.adoc b/docs/config/io_helidon_webserver_SocketConfiguration_SocketConfigurationBuilder.adoc index f6ed302218f..e57afdafaec 100644 --- a/docs/config/io_helidon_webserver_SocketConfiguration_SocketConfigurationBuilder.adoc +++ b/docs/config/io_helidon_webserver_SocketConfiguration_SocketConfigurationBuilder.adoc @@ -53,7 +53,7 @@ Type: link:{javadoc-base-url}/io.helidon.webserver.SocketConfiguration/io/helido Default is `false` |`host` |string |{nbsp} |A helper method that just calls #bindAddress(String). -|`max-header-size` |int |`8192` |Maximal number of bytes of all header values combined. When a bigger value is received, a +|`max-header-size` |int |`16384` |Maximal number of bytes of all header values combined. When a bigger value is received, a io.helidon.common.http.Http.Status#BAD_REQUEST_400 is returned. diff --git a/docs/config/io_helidon_webserver_WebServer.adoc b/docs/config/io_helidon_webserver_WebServer.adoc index b195d64e2d3..fe5ac64c18b 100644 --- a/docs/config/io_helidon_webserver_WebServer.adoc +++ b/docs/config/io_helidon_webserver_WebServer.adoc @@ -58,7 +58,7 @@ This is a standalone configuration type, prefix from configuration root: `server Default is `false` |`features.print-details` |boolean |`false` |Set to `true` to print detailed feature information on startup. |`host` |string |{nbsp} |A helper method that just calls #bindAddress(String). -|`max-header-size` |int |`8192` |Maximal number of bytes of all header values combined. When a bigger value is received, a +|`max-header-size` |int |`16384` |Maximal number of bytes of all header values combined. When a bigger value is received, a io.helidon.common.http.Http.Status#BAD_REQUEST_400 is returned. diff --git a/webserver/webserver/src/main/java/io/helidon/webserver/SocketConfiguration.java b/webserver/webserver/src/main/java/io/helidon/webserver/SocketConfiguration.java index 7e3cfe62964..b455a80e077 100644 --- a/webserver/webserver/src/main/java/io/helidon/webserver/SocketConfiguration.java +++ b/webserver/webserver/src/main/java/io/helidon/webserver/SocketConfiguration.java @@ -363,12 +363,12 @@ default B tls(Supplier tlsConfig) { * {@link io.helidon.common.http.Http.Status#BAD_REQUEST_400} * is returned. *

- * Default is {@code 8192} + * Default is {@code 16384} * * @param size maximal number of bytes of combined header values * @return this builder */ - @ConfiguredOption("8192") + @ConfiguredOption("16384") B maxHeaderSize(int size); /** @@ -483,8 +483,9 @@ final class Builder implements SocketConfigurationBuilder, io.helidon.c // methods with `name` are removed from server builder (for adding sockets) private String name = UNCONFIGURED_NAME; private boolean enabled = true; + // header size doubled comparing to default netty size + private int maxHeaderSize = 16384; // these values are as defined in Netty implementation - private int maxHeaderSize = 8192; private int maxInitialLineLength = 4096; private int maxChunkSize = 8192; private boolean validateHeaders = true; diff --git a/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParseFineTuning.java b/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParseFineTuning.java index 69f3d7e3661..5fbce92e3d7 100644 --- a/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParseFineTuning.java +++ b/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParseFineTuning.java @@ -53,11 +53,11 @@ void testDefaults() { .validateHeaders(false) .build(); - testHeader(client, 8000, true); + testHeader(client, 16000, true); testInitialLine(client, 10, true); - testHeader(client, 8900, false); - testHeader(client, 8900, false); + testHeader(client, 17000, false); + testHeader(client, 17000, false); // now test with big initial line testInitialLine(client, 5000, false); @@ -74,7 +74,7 @@ void testCustom() { .host("localhost") .routing(r -> r.any((req, res) -> res.send("any"))) .config(config) - .maxHeaderSize(9100) + .maxHeaderSize(16400) .maxInitialLineLength(5100) .build() .start() diff --git a/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParsingDefaults.java b/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParsingDefaults.java index 092bdf4b547..d6fbe75cdb9 100644 --- a/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParsingDefaults.java +++ b/webserver/webserver/src/test/java/io/helidon/webserver/TestHttpParsingDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Oracle and/or its affiliates. + * Copyright (c) 2020, 2022 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,13 +69,13 @@ static void destroyClass() throws InterruptedException, ExecutionException, Time @Test void testOkHeader() { - testHeader(8000, true); + testHeader(16000, true); } @Test void testLongHeader() { - testHeader(8900, false); - testHeader(8900, false); + testHeader(17000, false); + testHeader(17000, false); } @Test