File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/java/org/springframework/web/reactive/function/server
test/java/org/springframework/web/reactive/function/server Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public interface ServerRequest {
67
67
* Return the request path.
68
68
*/
69
69
default String path () {
70
- return uri ().getPath ();
70
+ return uri ().getRawPath ();
71
71
}
72
72
73
73
/**
Original file line number Diff line number Diff line change @@ -95,6 +95,17 @@ public void path() throws Exception {
95
95
assertFalse (predicate .test (request ));
96
96
}
97
97
98
+ @ Test
99
+ public void pathEncoded () throws Exception {
100
+ URI uri = URI .create ("http://localhost/foo%20bar" );
101
+ RequestPredicate predicate = RequestPredicates .path ("/foo bar" );
102
+ MockServerRequest request = MockServerRequest .builder ().uri (uri ).build ();
103
+ assertTrue (predicate .test (request ));
104
+
105
+ request = MockServerRequest .builder ().build ();
106
+ assertFalse (predicate .test (request ));
107
+ }
108
+
98
109
@ Test
99
110
public void pathPredicates () throws Exception {
100
111
PathPatternParser parser = new PathPatternParser ();
You can’t perform that action at this time.
0 commit comments