You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to RFC 6570 Section 3.2.1: reserved ("+") and fragment ("#") expansions allow the set of characters in the union of ( unreserved / reserved / pct-encoded ) to be passed through without pct-encoding, whereas all other expression types allow only unreserved characters to be passed through without pct-encoding.
But currently pct-encoded characters are being re-encoded. Meaning that {+var} and {#var} should not re-encode already pct-encoded triplets, but currently the implementation does that:
Code example
@TestvoidtextUriTemplate_shouldNotEncodeAlreadyPercentEncodedTriplets() {
Stringtemplate = "{+var}";
Map<String, Object> variables = Map.of("var", "admin%2F");
Stringresult = UriTemplate.expand(template, variables, false);
// Expecting the result to be "admin%2F" without encodingAssertions.assertEquals("admin%2F", result, "The encoded character should not be changed.");
}