multipart/form-data 請求最大總數問題

springboot版本升級到3.3.13+開始tomcat10.1.42+后,接口用multipart/form-data接收數據時,如果字段數量超過10個(tomcat默認值)則會報此錯誤。

解決辦法 yml 加上配置 max-part-count:1000(也可自定義給,適合自己項目需求即可)

server:
  tomcat:
    remoteip:
      protocol-header: X-Forwarded-Proto
    max-part-count: 1000 #推薦直接給1000 maxParameterCount默認1000 

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐