Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default to http max chunk size #10621

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class ServerLimitsConfig {
/**
* The max HTTP chunk size
*/
@ConfigItem
public Optional<MemorySize> maxChunkSize;
@ConfigItem(defaultValue = "8192")
public MemorySize maxChunkSize;

/**
* The maximum length of the initial line (e.g. {@code "GET / HTTP/1.0"}).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,7 @@ private static HttpServerOptions createSslOptions(HttpBuildTimeConfig buildTimeC
}
}
serverOptions.setMaxHeaderSize(httpConfiguration.limits.maxHeaderSize.asBigInteger().intValueExact());
Optional<MemorySize> maxChunkSize = httpConfiguration.limits.maxChunkSize;
if (maxChunkSize.isPresent()) {
serverOptions.setMaxChunkSize(maxChunkSize.get().asBigInteger().intValueExact());
}
serverOptions.setMaxChunkSize(httpConfiguration.limits.maxChunkSize.asBigInteger().intValueExact());
setIdleTimeout(httpConfiguration, serverOptions);

if (certFile.isPresent() && keyFile.isPresent()) {
Expand Down Expand Up @@ -708,10 +705,7 @@ private static HttpServerOptions createHttpServerOptions(HttpConfiguration httpC
options.setPort(httpConfiguration.determinePort(launchMode));
setIdleTimeout(httpConfiguration, options);
options.setMaxHeaderSize(httpConfiguration.limits.maxHeaderSize.asBigInteger().intValueExact());
Optional<MemorySize> maxChunkSize = httpConfiguration.limits.maxChunkSize;
if (maxChunkSize.isPresent()) {
options.setMaxChunkSize(maxChunkSize.get().asBigInteger().intValueExact());
}
options.setMaxChunkSize(httpConfiguration.limits.maxChunkSize.asBigInteger().intValueExact());
options.setWebsocketSubProtocols(websocketSubProtocols);
options.setReusePort(httpConfiguration.soReusePort);
options.setTcpQuickAck(httpConfiguration.tcpQuickAck);
Expand All @@ -730,10 +724,7 @@ private static HttpServerOptions createDomainSocketOptions(HttpConfiguration htt
options.setHost(httpConfiguration.domainSocket);
setIdleTimeout(httpConfiguration, options);
options.setMaxHeaderSize(httpConfiguration.limits.maxHeaderSize.asBigInteger().intValueExact());
Optional<MemorySize> maxChunkSize = httpConfiguration.limits.maxChunkSize;
if (maxChunkSize.isPresent()) {
options.setMaxChunkSize(maxChunkSize.get().asBigInteger().intValueExact());
}
options.setMaxChunkSize(httpConfiguration.limits.maxChunkSize.asBigInteger().intValueExact());
options.setWebsocketSubProtocols(websocketSubProtocols);
return options;
}
Expand Down