#527 - Revert a glitch introduced in move to Spring's UriComponentsBuilder API.
Our migration to the header handling for #509 (47cefe) unfortunately moved from starting with the servlet mapping for URI creation to using the full URI from the start. This is now fixed by switching back by creating a UriComponentsBuilder from the current servlet mapping. Related ticket: #509.
This commit is contained in:
@@ -32,7 +32,6 @@ import org.springframework.hateoas.core.AnnotationMappingDiscoverer;
|
||||
import org.springframework.hateoas.core.DummyInvocationUtils;
|
||||
import org.springframework.hateoas.core.LinkBuilderSupport;
|
||||
import org.springframework.hateoas.core.MappingDiscoverer;
|
||||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ConcurrentReferenceHashMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -264,7 +263,7 @@ public class ControllerLinkBuilder extends LinkBuilderSupport<ControllerLinkBuil
|
||||
static UriComponentsBuilder getBuilder() {
|
||||
|
||||
HttpServletRequest request = getCurrentRequest();
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(request));
|
||||
UriComponentsBuilder builder = ServletUriComponentsBuilder.fromServletMapping(request);
|
||||
|
||||
// special case handling for X-Forwarded-Ssl:
|
||||
// apply it, but only if X-Forwarded-Proto is unset.
|
||||
|
||||
Reference in New Issue
Block a user