Open gregturn opened 4 years ago
If the issue is closed due to no feedback from issuer / others, should we close / merge this one?
Hi,
I've notice that this does not work correctly if you are using DeferredResult<T>
and generating the HATEOAS link on another thread. It looks like it uses ThreadLocals requestAttributesHolder
and inheritableRequestAttributesHolder
in
org.springframework.web.context.request.RequestContextHolder#getRequestAttributes
called from
org.springframework.web.servlet.support.ServletUriComponentsBuilder#getCurrentRequest
If those ThreadLocals are not set, it drops the context path in the link that's generated.
I found this issue from https://github.com/spring-projects/spring-hateoas/issues/1268 which has been closed now.
When applying
server.servlet.context-path=/ctx
, the links automatically adjust.Testing with curl...