-
Notifications
You must be signed in to change notification settings - Fork 156
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
Modified DocumentMapper to use ServiceUrlProvider for generating document self links #793
base: master
Are you sure you want to change the base?
Conversation
…ment self links. This allows for relative urls (by emptying crnk.domain-name) and also improves configurability in situations where the system runs behind a proxy.
Taking another look at this, there was something odd with the behaviour in tests vs. behaviour in use. |
…BaseUrl as both respect the domain-name configuration.
I think I have a solid fix now. Instead of attempting to use ServiceUrlProvider, using When the below config is applied:
then
With an explicit domain set, it looks like this:
and with no domain-name configuration set at all, it still works as expected
|
It is a bit a dangerous area for changes because of the variety of integrations (servlet, etc.). Where have you seen that |
Finally got back to this. Basically there is similar behaviour here: where QueryContext is the source of the baseUrl. |
@remmeier Can we please merge this change? I need self link to be generated based on ServiceUrlProvider as well |
@@ -143,7 +145,8 @@ private LinksInformation enrichSelfLink(LinksInformation linksInformation, Query | |||
linksInformation = selfLinksInformation; | |||
} | |||
|
|||
JsonApiUrlBuilder.UrlParameterBuilder urlBuilder = new JsonApiUrlBuilder.UrlParameterBuilder(requestUri.toString()); | |||
JsonApiUrlBuilder.UrlParameterBuilder urlBuilder = new JsonApiUrlBuilder.UrlParameterBuilder(UrlUtils.concat(queryAdapter.getQueryContext().getBaseUrl(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what isnwring with the request uri? maybe a fix should be applied there if necessary. currently the code is inconsitent, having null check for resourceuri, but does not make use it.
This allows for relative urls (by emptying crnk.domain-name) and also improves configurability in situations where the system runs behind a proxy.
Fixes #789