WebClient
ignores port from baseUrl
#31315
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Affects: 5.3.28 and maybe older versions as well
Steps to reproduce:
WebClient
instance withbaseURL
which contains the port (WebClient.builder().baseUrl("localhost:8081")...
for example).webClient.uri("/test-endpoint")...
orwebClient.uri("test-endpoint")...
for example).Actual behavior:
Request is made to
localhost/test-endpoint
.Expected behavior:
Request is made to
localhost:8081/test-endpoint
.Such behavior is caused by this check in
org.springframework.web.util.HierarchicalUriComponents#copyToUriComponentsBuilder
.Documentation says nothing about this behavior, and it is quite illogical to me.
Is there a way to bypass this problem with current Spring version?
The text was updated successfully, but these errors were encountered: