From 529219dfe9a2de7dd5b98f1d47d40d3d6ba5e770 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 2 Apr 2018 17:31:12 -0400 Subject: [PATCH] Deprecate large max content length truncation 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. --- .../elasticsearch/http/netty4/Netty4HttpServerTransport.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java index fe5b52f99276b..1ccc9a27573af 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java @@ -263,6 +263,9 @@ public Netty4HttpServerTransport(Settings settings, NetworkService networkServic // validate max content length if (maxContentLength.getBytes() > Integer.MAX_VALUE) { logger.warn("maxContentLength[{}] set to high value, resetting it to [100mb]", maxContentLength); + deprecationLogger.deprecated( + "out of bounds max content length value [{}] will no longer be truncated to [100mb], you must enter a valid setting", + maxContentLength.getStringRep()); maxContentLength = new ByteSizeValue(100, ByteSizeUnit.MB); } this.maxContentLength = maxContentLength;