You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2019/05/23 12:11:00 UTC

[jira] [Resolved] (WICKET-6611) Missing check for IScopeAwareTextResourceProcessor when concatenating resources

     [ https://issues.apache.org/jira/browse/WICKET-6611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-6611.
-------------------------------------
       Resolution: Duplicate
         Assignee: Martin Grigorov
    Fix Version/s: 7.14.0
                   9.0.0-M2
                   8.5.0

Fixed with WICKET-6669

> Missing check for IScopeAwareTextResourceProcessor when concatenating resources
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-6611
>                 URL: https://issues.apache.org/jira/browse/WICKET-6611
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 8.1.0
>            Reporter: Thomas Heigl
>            Assignee: Martin Grigorov
>            Priority: Major
>             Fix For: 8.5.0, 9.0.0-M2, 7.14.0
>
>
> Resource concatenation cannot be used with text compressors relying on scope information.
> I tried to use {{CssUrlReplacer}} in my application and it failed on startup with an {{UnsupportedOperationException}} in the {{compress}} method.
> In {{CssPackageResource}} we have the following code:  
> {code:java}
> ICssCompressor compressor = getCompressor();
> if (compressor != null && getCompress())
> {
>    try
>    {
>       String charsetName = "UTF-8";
>       String nonCompressed = new String(processedResponse, charsetName);
>       String output;
>       if (compressor instanceof IScopeAwareTextResourceProcessor)
>       {
>          IScopeAwareTextResourceProcessor scopeAwareProcessor = (IScopeAwareTextResourceProcessor) compressor;
>          output = scopeAwareProcessor.process(nonCompressed, getScope(), name);
>       }
>       else
>       {
>          output = compressor.compress(nonCompressed);
>       }
>       return output.getBytes(charsetName);
>    }
>    catch (Exception e)
>    {
>       log.error("Error while filtering content", e);
>       return processedResponse;
>    }
> }{code}
> In {{ConcatBundleResource}} this {{instanceof}} is missing and {{compress}} is called directly.
> {code:java}
> if (getCompressor() != null)
> {
>    String nonCompressed = new String(bytes, "UTF-8");
>    bytes = getCompressor().compress(nonCompressed).getBytes("UTF-8");
> }{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)