Skip to content

Commit

Permalink
Merge pull request quarkusio#10610 from pcasaes/pc/http-max-initial-l…
Browse files Browse the repository at this point in the history
…ength

Add configuration for http max initial line length
  • Loading branch information
gastaldi authored Jul 9, 2020
2 parents a559b00 + 5746c0f commit 0e0457c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
18 changes: 1 addition & 17 deletions docs/src/main/asciidoc/http-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,7 @@ quarkus.http.cors.access-control-max-age=24H

== HTTP Limits Configuration

The following properties are supported.

[cols="<m,<m,<2",options="header"]
|===
|Property Name|Default|Description
|quarkus.http.limits.max-body-size| `10240K` |The maximum size of request body.
|quarkus.http.limits.max-header-size|`20K`|The maximum length of all headers.
|===

[NOTE]
====
The following config options will recognize sizes expressed as strings in this format (shown as a regular expression): `[0-9]+[KkMmGgTtPpEeZzYy]?`.
If no unit suffix is given, bytes are assumed.
* `quarkus.http.limits.max-body-size`,
* `quarkus.http.limits.max-header-size`
====
include::{generated-dir}/config/quarkus-vertx-http-config-group-server-limits-config.adoc[leveloffset=+1, opts=optional]

== Configuring HTTP Access Logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ public class ServerLimitsConfig {
*/
@ConfigItem
public Optional<MemorySize> maxChunkSize;

/**
* The maximum length of the initial line (e.g. {@code "GET / HTTP/1.0"}).
*/
@ConfigItem(defaultValue = "4096")
public int maxInitialLineLength;

}
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ private static HttpServerOptions createSslOptions(HttpBuildTimeConfig buildTimeC
serverOptions.setTcpQuickAck(httpConfiguration.tcpQuickAck);
serverOptions.setTcpCork(httpConfiguration.tcpCork);
serverOptions.setTcpFastOpen(httpConfiguration.tcpFastOpen);
serverOptions.setMaxInitialLineLength(httpConfiguration.limits.maxInitialLineLength);

return serverOptions;
}
Expand Down Expand Up @@ -716,6 +717,7 @@ private static HttpServerOptions createHttpServerOptions(HttpConfiguration httpC
options.setTcpQuickAck(httpConfiguration.tcpQuickAck);
options.setTcpCork(httpConfiguration.tcpCork);
options.setTcpFastOpen(httpConfiguration.tcpFastOpen);
options.setMaxInitialLineLength(httpConfiguration.limits.maxInitialLineLength);
return options;
}

Expand Down

0 comments on commit 0e0457c

Please sign in to comment.