Fix UriPathEncoder bug to improve performance
Fix `isAllowed` check and write test to ensure that additional object instances are not created unnecessarily. See gh-40615
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user