-
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)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
This relates to #33199
Due to the custom encryption of JARs we have a custom java.net.URLStreamHandler
on URL instance.
In recent versions (from 6.1.x) the reimplemented method org.springframework.util.ResourceUtils#toRelativeURL
fails to retain the original URLStreamHandler
on the root URL instance. Instead, it uses only the string part of the URL and creates a new one.
6.1.x:
toURL(StringUtils.applyRelativePath(root.toString(), relativePath));
vs
6.0.x:
new URL(root, relativePath);
I propose similar approach as was the fix for #33199
if (ResourceUtils.toURL(root.toString()).equals(root)) {
// Plain URL with default URLStreamHandler -> replace with cleaned path.
return toURL(StringUtils.applyRelativePath(root.toString(), relativePath));;
} else {
// Retain original URL instance, potentially including custom URLStreamHandler.
return new URL(root, relativePath);
}
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regressionA bug that is also a regression