javax.ws.rs.core.UriBuilder
is not escaping }
correctly:
import javax.ws.rs.core.UriBuilder;
public void test() {
final UriBuilder builder = UriBuilder.fromUri("http://host");
builder.path("dir}one");
l.info(builder.toString());
}
Will output http://host/dir}one
, leaving }
unescaped.
Whereas org.apache.http.client.utils.URIBuilder
:
org.apache.http.client.utils.URIBuilder;
public void testApache() {
final URIBuilder builder = new URIBuilder(URI.create("http://host"));
builder.setPath("dir}one");
l.info(builder.toString());
}
Will output http://hostdir%7Done
, escaping }
with %7D
as expected.
Is this a bug in the javax.ws.rs.core.UriBuilder
?