ServerRequest.path() should return raw path
After this commit, ServerRequest.path() returns the raw, unencoded path, as that is expected by the PathPatternParser.
This commit is contained in:
@@ -95,6 +95,17 @@ public class RequestPredicatesTests {
|
||||
assertFalse(predicate.test(request));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pathEncoded() throws Exception {
|
||||
URI uri = URI.create("http://localhost/foo%20bar");
|
||||
RequestPredicate predicate = RequestPredicates.path("/foo bar");
|
||||
MockServerRequest request = MockServerRequest.builder().uri(uri).build();
|
||||
assertTrue(predicate.test(request));
|
||||
|
||||
request = MockServerRequest.builder().build();
|
||||
assertFalse(predicate.test(request));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pathPredicates() throws Exception {
|
||||
PathPatternParser parser = new PathPatternParser();
|
||||
|
||||
Reference in New Issue
Block a user