Skip to content

Commit a44e905

Browse files
authored
Deprecate large max content length truncation (#29339)
Today if a user inputs a value for http.max_content_length that is greater than the setting can accomodate (Integer.MAX_VALUE), we truncate this to 100 MB (the default). This commit deprecates this leniency which will be removed in 7.0.0.
1 parent ef6097f commit a44e905

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java

+3
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ public Netty4HttpServerTransport(Settings settings, NetworkService networkServic
263263
// validate max content length
264264
if (maxContentLength.getBytes() > Integer.MAX_VALUE) {
265265
logger.warn("maxContentLength[{}] set to high value, resetting it to [100mb]", maxContentLength);
266+
deprecationLogger.deprecated(
267+
"out of bounds max content length value [{}] will no longer be truncated to [100mb], you must enter a valid setting",
268+
maxContentLength.getStringRep());
266269
maxContentLength = new ByteSizeValue(100, ByteSizeUnit.MB);
267270
}
268271
this.maxContentLength = maxContentLength;

0 commit comments

Comments
 (0)