Skip to content

Using X-Forwarded-Host header for building links #65

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

Open
mangvlad opened this issue Feb 6, 2013 · 3 comments
Open

Using X-Forwarded-Host header for building links #65

mangvlad opened this issue Feb 6, 2013 · 3 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@mangvlad
Copy link

mangvlad commented Feb 6, 2013

This was recently added to spring-hateoas: spring-projects/spring-hateoas#33

Can this work for spring-data-rest as well?

Thanks.

@jbrisbin
Copy link
Contributor

jbrisbin commented Feb 7, 2013

I'm not using the ControllerLinkBuilder because of the problems mentioned in that issue. But I can probably add code to Spring Data REST to also look for that header when setting a baseUri value (with the configuration value overriding even that).

It might also be nice to be able to plug in a component that would calculate a baseUri based on different criteria (a load-balancer, maybe?) instead of a static header value.

@mangvlad
Copy link
Author

mangvlad commented Feb 7, 2013

It would be the best solution to be able to provide your own strategy for this since using X-Forwarded-Host is not taking into account the protocol (it maybe https from the proxy, not http) and/or any additional path that proxy may have in-front of the URL...

Until this is implemented is there an easy way to provide this functionality? Can a new/custom/different bean be wired into this to do it?

Thanks.

@jbrisbin
Copy link
Contributor

jbrisbin commented Mar 7, 2013

The latest snapshots (and the M1 in the milestone repository) should deal with links differently since the self links are now rendered by the EntityLinks components and the baseUri is determined by the spring-hateoas machinery. Be interested to hear if that's the case.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants