Skip to content

Commit 4e53735

Browse files
committed
Tomcat multipart limit increase
1 parent ba2a168 commit 4e53735

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

gitb-testbed-service/src/main/java/com/gitb/tbs/config/BeanConfig.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.cxf.transport.servlet.CXFServlet;
2727
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
2828
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletRegistrationBean;
29+
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
2930
import org.springframework.boot.web.servlet.ServletRegistrationBean;
3031
import org.springframework.context.annotation.Bean;
3132
import org.springframework.context.annotation.Configuration;
@@ -100,4 +101,22 @@ public EndpointImpl processingClientService(Bus cxfBus, ProcessingClientImpl pro
100101
return endpoint;
101102
}
102103

104+
@Bean
105+
public TomcatServletWebServerFactory tomcatFactory() {
106+
return new TomcatServletWebServerFactory() {
107+
@Override
108+
protected void customizeConnector(org.apache.catalina.connector.Connector connector) {
109+
super.customizeConnector(connector);
110+
/*
111+
* Requests received by the validator web app are multipart requests (if performed
112+
* through the UI). In this case we need to make sure that Tomcat's limit to the
113+
* maximum number of multipart request parts does not block us (a default limit of
114+
* 10 was added in Tomcat release 10.1.42).
115+
*/
116+
connector.setMaxParameterCount(10000);
117+
connector.setMaxPartCount(100);
118+
}
119+
};
120+
}
121+
103122
}

0 commit comments

Comments
 (0)