Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ private static String createURI(
offset, encode, mapValues, sb);
if (sb.length() > sbLength) {
char firstQuery = sb.charAt(sbLength);
if (firstQuery != '?' && firstQuery != '&') {
if (firstQuery != '?' && (query.trim().charAt(0) != '{' || firstQuery != '&')) {
sb.insert(sbLength, '?');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,17 @@ public void testQueryParamStyleMultiPairs() {
"key1=val1&key1=val2&key2=val1&key1=val3");
}


@Test
public void testQueryParam() {
URI uri = new JerseyUriBuilder().scheme("http").host("localhost").port(8080).uri("some")
.replacePath("NewPath")
.replaceQuery("&Second")
.build();
Assertions.assertEquals("&Second", uri.getQuery());
}


@Test
void testFragment5269() throws URISyntaxException {
final URI uri = new URI("http://www.example.org/foo.xml#xpointer(//Rube)").normalize();
Expand Down