File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
spring-webmvc/src/main/java/org/springframework/web/servlet/resource Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 29
29
import org .apache .commons .logging .Log ;
30
30
import org .apache .commons .logging .LogFactory ;
31
31
32
+ import org .springframework .util .Assert ;
32
33
import org .springframework .web .filter .GenericFilterBean ;
33
34
import org .springframework .web .util .UrlPathHelper ;
34
35
@@ -93,6 +94,10 @@ private void initLookupPath(ResourceUrlProvider urlProvider) {
93
94
String requestUri = pathHelper .getRequestUri (this );
94
95
String lookupPath = pathHelper .getLookupPathForRequest (this );
95
96
this .indexLookupPath = requestUri .lastIndexOf (lookupPath );
97
+ Assert .isTrue (this .indexLookupPath != -1 ,
98
+ "Failed to find lookupPath '" + lookupPath + "' within requestUri '" + requestUri + ". " +
99
+ "Does the path have invalid encoded characters " +
100
+ "for characterEncoding=" + getRequest ().getCharacterEncoding () + "?" );
96
101
this .prefixLookupPath = requestUri .substring (0 , this .indexLookupPath );
97
102
if ("/" .equals (lookupPath ) && !"/" .equals (requestUri )) {
98
103
String contextPath = pathHelper .getContextPath (this );
You can’t perform that action at this time.
0 commit comments