-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
org.springframework.util.ResourceUtils#toRelativeURL
drops custom URLStreamHandler
#33561
Comments
I used xjar here to upgrade to spring 3.x and encountered this problem:core-lib/xjar#133 |
org.springframework.util.ResourceUtils#toRelativeURL
drops custom URLStreamHandler
It looks like depending on the @ljcvok what specific condition causes that |
@jhoeller @fendo8888 We have resolved the "clean path" issue, which caused the fix for issue #33199 to be effectively overlooked. One potential workaround would be to compare If the Spring team truly intends to clean up and create new URL instances and drop the custom URL handler, we would need to redesign our solution completely. |
It turns out there is a way to retain our own relative path building: namely, to concatenate and clean the overall path ourselves and then pass it to I'm going to use that approach for |
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 originalURLStreamHandler
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
The text was updated successfully, but these errors were encountered: