-
Notifications
You must be signed in to change notification settings - Fork 471
Added X-Forwarded-Path to ControllerLinkBuilder #409
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
Conversation
I'm trying to find a spec for x-forwarded-path to check things out and I can't. Do you have link documenting proper behavior? |
@gregturn - no, unfortunately I don't have any supporting documentation. I came across it (generally), while looking for documentation on Unless I'm mistaken, use of HTTP header prefix Let me know what you want me to do with this... |
The issue number would probably help too... #143 |
Hi all - just wondering, who can action the backlog of push requests? There's a few that have been sitting around for a while now. @gregturn @rgladwell @olivergierke |
We can't just add some code for a header that's not specified anywhere. The headers we currently support are documented in this RFC. |
+1 Didn't see this PR before creating #431 . |
As indicated above, nothing of this is going to make it unless we find a reliable source specifying the behavior of that header. |
Apparently, the RFC has no mention for X-Forwarded-Host nor X-Forwarded-Port. X-Forwarded-Path is a made up header with no specification, but there seems to be a concensus as to how it should be used in proxies (see here, and here for examples). Since it is a non invasive solution meaning that not using this header has no side effects, and that its definition is quite clear, it can be included in spring-hateoas. |
+1 for precedent... ( 3f8b90e -> @olivergierke - is this where Is Thanks, Nick |
X-Forwarded-* appears governed by a draft spec here => http://tools.ietf.org/html/draft-ietf-appsawg-http-forwarded-10 Interestingly, I found RFC7239 here => http://tools.ietf.org/html/rfc7239, which appears designed to replace all the X-Forwarded headers. If that's not enough fun, RFC6648 deprecates the "X-" prefix. Not sure how to square non-standard, haphazard headers with a newly minted spec for the best approach on this project. |
Ok, well I'm happy with whatever you guys decide. Just a thought, what if the |
I was wondering what the specification of this seems to be. I've run into the same issue and really need a X-Forwarded-Path or equivalent header (to a reverse proxied rest service to avoid needing cross origin requests from a html5 client). RFC7239 seems to leave room for a Forwarded-Path header in section 5.5 (Extensions), specifically mentioning the reverse proxy situation. The problem with ControllerLinkBuilder as it is now is that there is no way to alter or extend it's behavior: the constructor is package scoped, the getBuilder() as well as the linkTo methods are all static, and the "wiring" of the UriComponentsBuilder instance is fixed by the getBuilder() method implementation. The only option I see at the moment is to just copy the class and modify it and use the modified one instead; but it's not a very nice option. |
I developed a framework to render links in spring hateoas projects. In the current snapshot I'm working on clarifying the extension points. One of these extension points allows you to customize how url parts are obtained. There is a chain of reponsability in which each processing object can contribute with url parts (scheme, host, port and context path). This integration test using this configuration shows how it can integrate your own processing object into the chain. |
4ebc1be
to
266ad50
Compare
Should be obsolete now. Current master is delegating this to UriComponentsBuilder, which is base-path aware. (use |
Sure? This one is about |
Well, that should be the header to set if you want to add a base-path to your URLs. |
Funny, how I end up finding a ticket and personally knowing everyone involved. The project right here is using |
@nickgrealy Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@nickgrealy Thank you for signing the Contributor License Agreement! |
Fyi @olivergierke - I'm closing this PR due to inactivity. I can reopen again if requested. |
I've added
Added X-Forwarded-Path
handling in the ControllerLinkBuilder, so that context paths can be handled.I have signed and agree to the terms of the Spring Individual Contributor
License Agreement.