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 for X-Forwarded-Prefix in ServletUriComponentsBuilder [SPR-12500] #17105

Closed
spring-projects-issues opened this issue Dec 3, 2014 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 3, 2014

Dave Syer opened SPR-12500 and commented

If a proxy strips a prefix from the path before forwarding it might add an X-Forwarded-Prefix header. It's not as common as X-Forwarded-Host (but neither is a standard, just a convention). If the backend has to send a Location header back (for instance) it needs to re-add the prefix to the URL path. It's very similar to what ServletUriComponentsBuilder is already doing, but with an extra path element in the URL.


Affects: 4.1.2

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Actually this isn't quite finished if I understand correctly. If caller uses ServletUriComponentsBuilder.fromRequest() directly it does what he expects, but if he calls ServletUriComponentsBuilder.fromContextPath() then the path is overwritten with no reference to the prefix header.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Good point, thanks for catching that. It should be fixed now (currently building).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants