WebClient no longer encodes query parameters [SPR-17532] #22064
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: duplicate
A duplicate of another issue
Uh oh!
There was an error while loading. Please reload this page.
ShaManHFel opened SPR-17532 and commented
The following sample code used to work in 5.0.8 but stopped working in 5.1.2:
WebClient.builder()
.baseUrl("https://www.google.com")
.build()
.get()
.uri(builder -> builder
.path("search")
*.queryParam("q", "some spaces in the value")*
.build())
.retrieve()
.bodyToMono(String.class)
.block();{color
}In 5.0.8 the result from this code was the following call:
In 5.1.2 the result is:
As evident from the error, the queryParam() method no longer encodes the query parameter values. This seems to be caused by a change in DefaultUriBuilderFactory where the default encoding mode was changed ``to
EncodingMode.TEMPLATE_AND_VALUES.Affects: 5.1.2
Issue Links:
The text was updated successfully, but these errors were encountered: