Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
PathResourceResolver.isResourceUnderLocation does not handle relative paths correctly [SPR-12624] #17225
My resources location path has a .. element in it like this: file:C:/dev/project/module1/../module2/src/resources. Resource paths get checked against this location path in https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java#L181, and it gets wrongly turned down (false is returned) because the resource path has already been cleaned in
I believe you should be using the cleaned paths for both the resource and the location.