Created
June 9, 2015 14:14
-
-
Save dalesupa22/2b5f67afd7a8b3a39714 to your computer and use it in GitHub Desktop.
How to edit the default maxPostSize of embedded Tomcat in SpringBoot
This file contains hidden or 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
@Bean | |
EmbeddedServletContainerCustomizer containerCustomizer( | |
) throws Exception { | |
return (ConfigurableEmbeddedServletContainer container) -> { | |
if (container instanceof TomcatEmbeddedServletContainerFactory) { | |
TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) container; | |
tomcat.addConnectorCustomizers( | |
(connector) -> { | |
connector.setMaxPostSize(10000000);//10MB | |
} | |
); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks buddy 👍 Really helpful