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

Spring Cloud Gateway MVC : Multipart + Query Param is not working

Open
#3,485 3 comments 1 reaction 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
Send multipart request and also query parameter, the query parameter is not forwarded to backend service

Spring Cloud Version : 2023.0.3

Sample

spring.cloud.gateway.mvc.routes[0].id=NOCHECK
spring.cloud.gateway.mvc.routes[0].uri=https://engvxhu8p8n2b.x.pipedream.net
spring.cloud.gateway.mvc.routes[0].predicates[0]=Path=/backend/nocheck/**

Example Curl :

curl --location 'http://localhost:8089/backend/nocheck/eko?orderId=27006607934&storeId=10001&clientId=off2on-mobile&channelId=off2on-mobile&requestId=7bcf27c6-ef84-4715-9a9b-a77ff77ddb43&username=b80edb9d-790e-4563-aaf8-a61dd128a653%40blibli' \
--header 'Content-Type: multipart/form-data' \
--form 'name="Eko"' \
--form 'hello="test"'

Backend Received :

CleanShot 2024-07-31 at 14 56 29@2x

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 Spring Cloud Gateway MVC route configuration and reproduce the issue using the provided curl request, including both multipart fields and query parameters. Trace how this request is forwarded to the backend; done means the backend receives the query parameters together with the multipart form data.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.