Skip to content

CssLinkResourceTransformer is incompatible with FixedVersionStrategy VersionResourceResolver [SPR-13727] #18300

@spring-projects-issues

Description

@spring-projects-issues

Michael Russo opened SPR-13727 and commented

When attempting to use Spring MVC 4.1's web static resource handling outlined in this blog post, and choosing to use the VersionResourceResolver's FixedVersionStrategy, the automatically-configured CssLinkResourceTransformer will corrupt relative path URLs in CSS resources.

A resource such as "../images/logo.png" will be converted to an incorrect URL "<version>/../images/logo.png".

A known workaround for this issue is to use the ContentVersionStrategy instead of FixedVersionStrategy.


Affects: 4.1.8, 4.2.3

Reference URL: http://stackoverflow.com/questions/28875565/versionresourceresolver-breaks-css-relative-urls

Issue Links:

Referenced from: commits c226753, f53d01b

Backported to: 4.1.9

0 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)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