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

Peter Ertl updated WICKET-3845:
-------------------------------

    Attachment: custom-headers.patch

patch (= proposal) attached:

the following methods will be added:

  ResourceResponse#setCustomHeader(name, value)
  ResourceResponse#getCustomHeaders()

Having a callback like

  configureHeaders(...)

will not be as good *imho* since the callback has no relationship to the code 
that actually creates the resource in AbstractResource#newResourceResponse(..).

With these additional methods you can simply add custom headers like 'Range', 
'X-Special-Header', etc. in #newResourceResponse when generating the response.


> There is not a good way to use custom response headers with AbstractResource
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-3845
>                 URL: https://issues.apache.org/jira/browse/WICKET-3845
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>            Reporter: Adriano dos Santos Fernandes
>             Fix For: 1.5-RC6
>
>         Attachments: custom-headers.patch
>
>
> I'm converting an application to Wicket 1.5 and I see some problems with 
> resources.
> There is a case I need to add headers (not present in ResourceResponse 
> properties) and it looks ugly.
> This is what I need to do:
>     @Override
>     protected void configureCache(ResourceResponse data, Attributes 
> attributes)
>     {
>         super.configureCache(data, attributes);
>         ((WebResponse) attributes.getResponse()).setHeader("Accept-Ranges", 
> "bytes");
>     }
> It's a hack to use configureCache here, but this can't be added to 
> setResponseHeaders, which seams a better apparent method name for it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to