From b73e5d59a8caec1b214a96742bde5b47d2b328d8 Mon Sep 17 00:00:00 2001 From: Falco Duersch Date: Wed, 29 Apr 2020 09:29:09 +0200 Subject: [PATCH] Fix behavior of maxPostSize in Tomcat 10 (#144) Connector#setProperty is a bit of a lie. It does not set properties on the Connector. Rather, the method set properties on the protocol handler which is part of the connector. Thus, the previous implementation tried to set a connector property using setProperty, which was never successful. Instead we directly set the property of the connector. To achieve the original intent ("unlimited post size") the value must be below zero. See: http://tomcat.apache.org/tomcat-10.0-doc/config/http.html#Common_Attributes --- .../groovy/org/akhikhl/gretty/TomcatServerConfigurer.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServerConfigurer.groovy b/libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServerConfigurer.groovy index cd897cba3..20307aa28 100644 --- a/libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServerConfigurer.groovy +++ b/libs/gretty-runner-tomcat/src/main/groovy/org/akhikhl/gretty/TomcatServerConfigurer.groovy @@ -111,7 +111,7 @@ class TomcatServerConfigurer { if(params.httpIdleTimeout) httpConn.setProperty('keepAliveTimeout', params.httpIdleTimeout.toString()) - httpConn.setProperty('maxPostSize', '0') // unlimited post size + httpConn.maxPostSize = -1 // unlimited post size if(newHttpConnector) { service.addConnector(httpConn) @@ -191,7 +191,7 @@ class TomcatServerConfigurer { if(params.httpsIdleTimeout) httpsConn.setProperty('keepAliveTimeout', params.httpsIdleTimeout.toString()) - httpsConn.setProperty('maxPostSize', '0') // unlimited + httpsConn.maxPostSize = -1 // unlimited if(newHttpsConnector) { service.addConnector(httpsConn)