Skip to content

Be more defensive in UrlResource about cleaning the path [SPR-17198] #21732

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-17198 and commented

This method from UrlResource throws UnsupportedFeatureError in GraalVM:

private URL getCleanedUrl(URL originalUrl, String originalPath) {
     try {
          return new URL(StringUtils.cleanPath(originalPath));
     }
     catch (MalformedURLException ex) {
          // Cleaned URL path cannot be converted to URL
          // -> take original URL.
          return originalUrl;
     }
}

So the originalUrl would have been fine, but it cannot get past this private method to read the input stream. We could be more defensive there.


Affects: 5.0.8

Reference URL: oracle/graal#623

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions