Created
July 15, 2019 16:16
-
-
Save h-hub/6346ac6d08114427cad0eba208c85676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class WebMvcConfig implements WebMvcConfigurer { | |
@Bean | |
public ConfigurableServletWebServerFactory webServerFactory() { | |
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); | |
tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> { | |
// configure maxSwallowSize | |
if ((connector.getProtocolHandler() instanceof AbstractHttp11Protocol<?>)) { | |
// -1 means unlimited, accept bytes | |
((AbstractHttp11Protocol<?>) connector.getProtocolHandler()).setMaxSwallowSize(-1); | |
} | |
}); | |
tomcat.setPort(8089); | |
return tomcat; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment