6

I'm running a spring-boot service with an embed tomcat container.

Is there a way to limit the size of a HTTP PUT request via common application properties or EmbeddedServletContainerFactory? Thanks

  • I am not even sure that tomcat has such feature. It has for POST which I am sure you're aware since you specified PUT in bold. If tomcat has this feature then yes you can customize that via `org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer` – Stephane Nicoll Jul 30 '15 at 07:04
  • maybe unrelated but there is `multipart.maxFileSize` property – sodik Jul 30 '15 at 07:07
  • @sodik the multipart properties are considered only for multipart data requests, I tested it. Thanks anyway. – accurate respondetur Jul 30 '15 at 12:31
  • yes, I know - that's why I said `maybe unrelated` - but maybe it can help in someone's situation. – sodik Jul 30 '15 at 12:35
  • I am facing the same issue, do you have any answer now? – morgan117 Jul 17 '19 at 08:23

1 Answers1

1

Add this property in your application.properties file.

spring.http.multipart.max-request-size=10MB

Refer below for more information:

https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

Tanmay Delhikar
  • 1,275
  • 11
  • 16