mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch '3.2.x'
See gh-40616
This commit is contained in:
commit
3b66eb7bb7
@ -36,7 +36,7 @@ final class 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);
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,10 @@ class UriPathEncoderTests {
|
||||
assertThat(UriPathEncoder.encode("/Z\u00fcrich")).isEqualTo("/Z%C3%BCrich");
|
||||
}
|
||||
|
||||
@Test
|
||||
void encodePathWhenNoEncodingIsRequiredReturnsSameInstance() {
|
||||
String path = "/foo/bar";
|
||||
assertThat(UriPathEncoder.encode(path)).isSameAs(path);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user