Skip to content

URIEditor should not double escape classpath: URIs [SPR-16581] #21123

@spring-projects-issues

Description

@spring-projects-issues

Gerhard Bloch opened SPR-16581 and commented

My Tomcat installation has a space character in the path (installation is provided so I cannot change this). I want to configure my EhCache via JCacheManagerFactoryBean, property cacheManagerUri=classpath:ehcache.xml. The resource URL yields something like ...%20... which is the correct encoding of the space character, but then the default URIEncoder (which is "encoding" by default) encodes the percent sign and I end up with a URI like ...%2520... which does not work for obvious reasons. I do not understand why the URIEditor needs to "encode" at all, looks like fixing broken URIs at the wrong place, but at least for the case of classpath: URI's I absolutely do not see a point in applying any additional encoding. The resource gives a valid URL and this is just fine as it is.

I suggest to replace the createURI(url) in URIEditor:110 by a simple new URI(url). Running such patch fixes the issue for me.


Affects: 4.3.14, 5.0.4

Issue Links:

Backported to: 4.3.15

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions