Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

org.springframework.util.ResourceUtils#toRelativeURL drops customURLStreamHandler #33561

Closed
Assignees
jhoeller
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression
Milestone
@ljcvok

Description

@ljcvok

This relates to#33199

Due to the custom encryption of JARs we have a customjava.net.URLStreamHandler on URL instance.
In recent versions (from 6.1.x) the reimplemented methodorg.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

if (ResourceUtils.toURL(root.toString()).equals(root)) {// Plain URL with default URLStreamHandler -> replace with cleaned path.returntoURL(StringUtils.applyRelativePath(root.toString(),relativePath));;}else {// Retain original URL instance, potentially including custom URLStreamHandler.returnnewURL(root,relativePath);}

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp