Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PathResourceResolver.isResourceUnderLocation does not handle relative paths correctly [SPR-12624] #17225

Closed
spring-issuemaster opened this issue Jan 13, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jan 13, 2015

Eduard Semsch opened SPR-12624 and commented

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

public Resource createRelative(String relativePath) throws MalformedURLException {
but the location path hasn't been cleaned. The paths are of type UrlResource.

I believe you should be using the cleaned paths for both the resource and the location.


Affects: 4.1.4

Issue Links:

  • #17269 Resource Handler is not Forwarding to correct Resource Location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.