[英]How to limit full payload size in spring-boot-starter-web?
I want to limit the full rest request size (including headers/body etc.).我想限制完整的 rest 请求大小(包括标题/正文等)。 Is their a way to do that via configuration or via code?
他们是通过配置还是通过代码来做到这一点?
I've tried the follwoing but it doesn't work.我已经尝试了以下方法,但它不起作用。
spring.servlet.multipart.max-request-size=1MB
spring.servlet.multipart.enabled=true
Just use this config in src/main/resources/application.properties只需在 src/main/resources/application.properties 中使用此配置
spring.servlet.multipart.max-file-size=1024KB
spring.servlet.multipart.max-request-size=1024KB
You can check this on the default documentation https://spring.io/guides/gs/uploading-files/您可以查看默认文档https://spring.io/guides/gs/uploading-files/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.