RosHTTP icon indicating copy to clipboard operation
RosHTTP copied to clipboard

Escaped Questionmark in URI is not handled correctly

Open dthoma opened this issue 7 years ago • 1 comments

When a request is created from an URI containing an escaped ? the ? will still be interpreted as the start of a query string, e.g. HttpRequest("http://localhost/foo%3Fbar") fails to access the right resource.

This is due to using java.net.URI to parse the URI and URI.getPath returning the path with (partially) escaped segments.

A workarround therefore is to use withPath: HttpRequest("http://localhost").withPath("/foo%3Fbar") works as expected.

dthoma avatar Jan 29 '18 23:01 dthoma

I guess getRawPath needs to be used instead of getPath. Maybe other calls need to similarly adapted, e.g., getRawQuery instead of getQuery?

sjrd avatar Jan 30 '18 10:01 sjrd