-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement
Milestone
Description
When creating a FileSystemResource
with a Path
containing ..
in the path, then createRelative
resolves to a wrong path.
The problem resides on StringUtils::applyRelativePath
method: I suggest change the method on FileSystemResource
checking first if the location is a Path
and then use Path::resolve
instead calling StringUtils::applyRelativePath
.
println(FileSystemResource(Paths.get("../xxxx/dist/")).createRelative("index.html"))
print ../index.html
instead ../xxx/dist/index.html
.
Attached image shows the variables inside FileSystemResource::createRelative
method.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: enhancementA general enhancementA general enhancement