[ https://issues.apache.org/jira/browse/SLING-7760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17027709#comment-17027709 ]
Jason E Bailey commented on SLING-7760: --------------------------------------- [~bdelacretaz] My thought process for this is that I wanted to be as careful as possible so as to not impact the performance of the Main servlet and not to provide an avenue for someone to put in more functionality than needed. I could certainly change the request path to a resource object. When I said returning headers, I was thinking a List<String> of headers to be mapped into the Response headers. I wouldn't want to pass something like the response object directly as we could end up with situations where people could create an implementation of the interface that returned content or did all sorts of odd stuff at the wrong level. > 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)