Skip to content

Commit

Permalink
Merge branch '3.2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed May 3, 2024
2 parents 259d7fd + 8a72e55 commit 3b66eb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private UriPathEncoder() {
static String encode(String path) {
byte[] bytes = path.getBytes(StandardCharsets.UTF_8);
for (byte b : bytes) {
if (isAllowed(b)) {
if (!isAllowed(b)) {
return encode(bytes);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ void encodePath() {
assertThat(UriPathEncoder.encode("/Z\u00fcrich")).isEqualTo("/Z%C3%BCrich");
}

@Test
void encodePathWhenNoEncodingIsRequiredReturnsSameInstance() {
String path = "/foo/bar";
assertThat(UriPathEncoder.encode(path)).isSameAs(path);
}

}

0 comments on commit 3b66eb7

Please sign in to comment.