Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
8.5.0
-
None
Description
There is "double scope processing" of a url in a PackageResource when the CssCompressor set on the Application ResourceSettings implements .IScopeAwareTextResourceProcessor.
The CssUrlReplacer (for example) makes the urls relative during the PackageResource.compressResponse call. The compressResponse ends up being called in ConcatBundleResource.readAllResources as part of `IOUtils.copy(curStream.getInputStream(), output)` and then ConcatBundleResource calls CssUrlReplacer.process again.
https://github.com/apache/wicket/commit/e2a11151e2bc55ae3a637efd88b1202582461780/ causes a "double scope processing" of a url in a PackageResource. The second application of the CssCompressor happens here https://github.com/apache/wicket/commit/e2a11151e2bc55ae3a637efd88b1202582461780/#diff-b394ae1f7fce4...
Set the CssCompressor on the Application. Something like this in the Application `init` for example:
this.getResourceSettings().setCssCompressor(new CssUrlReplacer())
The CssUrlReplacer gets set on both the PackageResource and ConcatBundleResource as the Compressor.
So, given this in the PackageResource css:
background: url('../img/header_logo_r.png');
this bad url gets inserted into the combined css file:
background (generated in 8.5.0+): url('../com.foo.pages.SomePage/stylesheet/com.foo.pages.SomePage/img/header_logo_r-ver-1.4.0-ver-1.4.0.png')
whereas this is the correct ScopeAware path (which is generated in <8.5.0):
background: url('../com.foo.pages.SomePage/img/header_logo_r-ver-1.4.0.png')
Attachments
Attachments
Issue Links
- is caused by
-
WICKET-6669 CSS Resource Bundling throws exception when used with CssUrlReplacer
- Resolved