File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
main/java/org/springframework/web/util/pattern
test/java/org/springframework/web/util/pattern Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,15 @@ else if (!StringUtils.hasLength(pattern2string.patternString)) {
397
397
this .patternString .substring (0 , this .patternString .length () - 2 ),
398
398
pattern2string .patternString ));
399
399
}
400
+
401
+ if (this .patternString .endsWith ("/*" )) {
402
+ String base = this .patternString .substring (0 , this .patternString .length () - 2 );
403
+ if (pattern2string .patternString .contains ("/" )) {
404
+ throw new IllegalArgumentException ("Cannot combine single-segment wildcard '/*' with multi-segment path '" +
405
+ pattern2string .patternString + "'" );
406
+ }
407
+ return this .parser .parse (concat (base , "/" + pattern2string .patternString ));
408
+ }
400
409
401
410
// /hotels + /booking => /hotels/booking
402
411
// /hotels + booking => /hotels/booking
Original file line number Diff line number Diff line change 32
32
33
33
import static org .assertj .core .api .Assertions .assertThat ;
34
34
import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
35
+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
35
36
36
37
/**
37
38
* Exercise matching of {@link PathPattern} objects.
You can’t perform that action at this time.
0 commit comments