[ 
https://issues.apache.org/jira/browse/SLING-7760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17014357#comment-17014357
 ] 

Jason E Bailey commented on SLING-7760:
---------------------------------------

[~cziegeler]I don't need a plugin model. What I need is:
 # Ability to set a header on a per site basis
 # Ability to change the headers without causing a restart of the Application
 ## This was handled by SLING-8991 Thanks!

And potentially being able to set headers based on the resource. This would be 
convenient for setting expiration dates on assets. etc.

My problem when I was working with this is that once you write to the output 
stream you're no longer able to modify the headers. On a per application basis 
I could configure a filter and make sure it would work. But for a feature of 
the product I couldn't come up with a better solution then to have the headers 
set in the Main Servlet. 

 

 

> Sling Main Servlet - Change header configuration to a service
> -------------------------------------------------------------
>
>                 Key: SLING-7760
>                 URL: https://issues.apache.org/jira/browse/SLING-7760
>             Project: Sling
>          Issue Type: Improvement
>            Reporter: Jason E Bailey
>            Assignee: Jason E Bailey
>            Priority: Major
>
> The ability to set headers must be done prior to any writing that occurs the 
> output stream. This is the reason why the headers are set to be configured in 
> the Sling Main Servlet.
> With Sling being used to maintain multiple sites, having a single set of 
> response headers creates problems where the header provides a non tailored 
> response. One site may have a conflicting set of requirements then another 
> site.
> If the setting of headers was moved from being a configuration to being a 
> service used by the Main Servlet, this would allow the following:
>  * Headers set on a per site basis
>  * Headers based on selected resource
>  * Ability to modify the headers without causing the restart of the Sling 
> Main Servlet
>  ** Which if you're dealing with CSP headers can be a constant pain
>  * Ability to create a CSP configuration Service that eases the use of CSP 
> creation
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to