-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Guillaume DROUET opened SPR-12137 and commented
Hi,
When the CssLinkResourceTransformer use the ResourceResolverChain#resolveUrlPath method to retrieve a resource referenced with url or @import
, it gives as parameter the complete path. This is not what the ResourceUrlProvider does: before calling the chain, it removes the beginning of the path corresponding to the matching pattern.
Imagine you have the following configuration: registry.addResourceHandler("/css/**").addResourceLocations("classpath:/statics/css/")
If I resolve '/css/app.css' with ResourceUrlProvider, PathResourceResolver receives 'app.css' to resolve.
Now imagine in app.css a statement like this: @import
"/css/app2.css";
In that case PathResourceResolver receives '/css/app2.css' from CssLinkResourceTransformer instead of 'app2.css'. The chain will return null and URL won't be transformed.
CssLinkResourceTransformer should rely on the same mechanism as ResourceUrlProvider.
Affects: 4.1 RC2
Referenced from: commits 125ae99