Closed jmp0x00 closed 4 years ago
Describe the bug Spaces in route parameters are encoded as plus signs.
To Reproduce
@Test public void spacesInRouteParamArePercentEncoded() { HttpRequest<?> request = Unirest.get("https://en.wikipedia.org/wiki/{pageName}") .routeParam("pageName", "Mosaics of Delos"); System.out.println(request.getUrl()); Assertions.assertTrue(request.asEmpty().isSuccess()); }
Expected behavior Spaces in route parameters must be encoded as %20 sequence.
Screenshots Not applicable.
Environmental Data:
Additional context The unirest uses URLEncoder class to encode route parameters, but it should be used for HTML form encoding, not for path encoding.
fixed in 3.4.02
Describe the bug Spaces in route parameters are encoded as plus signs.
To Reproduce
Expected behavior Spaces in route parameters must be encoded as %20 sequence.
Screenshots Not applicable.
Environmental Data:
Additional context The unirest uses URLEncoder class to encode route parameters, but it should be used for HTML form encoding, not for path encoding.