spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

servlet.multipart.enabled is disabled by default in 4.2.1

Open Lemick opened this issue 9 months ago • 0 comments

Describe the bug Starting from Spring Cloud Gateway 4.2.1, the default behavior for handling multipart requests has changed. If servlet.multipart.enabled: true is not explicitly set, this setting is disabled by MultipartEnvironmentPostProcessor and body parameters from multipart/form-data requests are not accessible.

This differs from previous behavior and from Spring Boot’s default, making it an unexpected change for users upgrading. Maybe a reference in the release notes or in the documentation could be useful ?

Sample A minimal Spring Boot application using spring-cloud-starter-gateway-mvc:4.2.1 with a POST request containing multipart/form-data parameters does not receive expected body parameters unless the following is explicitly added:

spring:
  servlet:
    multipart:
      enabled: true

Lemick avatar Apr 02 '25 08:04 Lemick