spring-cloud / spring-cloud/spring-cloud-gateway

servlet.multipart.enabled is disabled by default in 4.2.1

Open
#3,749 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Spring Boot application described in the issue and verify multipart/form-data body parameters with spring-cloud-starter-gateway-mvc:4.2.1. Inspect MultipartEnvironmentPostProcessor and the release notes or documentation to determine how this changed from previous behavior. Done means the behavior is corrected or the setting and upgrade impact are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.