Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-value X-Forwarded-Prefix headers #25254

Closed
hgarus opened this issue Jun 15, 2020 · 0 comments
Closed

Support multi-value X-Forwarded-Prefix headers #25254

hgarus opened this issue Jun 15, 2020 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@hgarus
Copy link

hgarus commented Jun 15, 2020

When spring-cloud-gateway adds an X-Forward-Prefix header to a request on which an X-Forwarded-Prefix header is already present, the second value is added to the header separating both using comma.

This is currently not supported by the ForwardedHeaderFilter. The Filter prefixes the path with the full value of the Header, adding the commas to the Path. I haven't tested this with Webflux, but looking at ForwardedHeaderTransformer it doesn't seem to support this either.

I first opened this as an issue on the spring-cloud-gateway tracker (spring-cloud/spring-cloud-gateway#1772) after some discussion with @spencergibb we decided to move this over here.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 15, 2020
@bclozel bclozel self-assigned this Jun 17, 2020
@bclozel bclozel changed the title Support multi value X-Forwarded-Prefix headers generated by spring-cloud-gateway Support multi-value X-Forwarded-Prefix headers Jun 18, 2020
@bclozel bclozel added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 18, 2020
@bclozel bclozel added this to the 5.3 M1 milestone Jun 18, 2020
kenny5he pushed a commit to kenny5he/spring-framework that referenced this issue Jun 21, 2020
Prior to this commit, the Forwarded headers for Spring MVC and Spring
WebFlux did not support multiple prefix values for the
`"X-Forwarded-Prefix"` HTTP header.

This commit splits and processes multiple prefixes defined in the
dedicated header.

Closes spring-projectsgh-25254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants