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

Joerg Hoh updated SLING-13413:
------------------------------
    Description: 
Right now, when a request to a non-HTML resource fails, the DefaultErrorServlet 
is resolved, which in most cases is not built to explicitly handle requests to 
non-HTML resources and therefor always returns either JSON (if the accept 
header indicates JSON) or HTML for eveything else.

In that case, a request to /content/non-existing-image.png will often returns 
the HTML error page, even if the browser indicated in the accept header, that 
it won't handle text/html  for this request. Next to potential security 
problems this can cause performance problems if the creation of the error page 
is expensive.

We need to have a dedicated handling for non-JSON and non-HTML responses, which 
just set the statuscode. No response body is required in these cases.

  was:
Right now, when a request to a non-HTML resource fails, the DefaultErrorServlet 
is resolved, which in most cases is not built to explicitly handle requests to 
non-HTML resources and therefor always returns either JSON (if the accept 
header indicates JSON) or HTML for eveything else.

In that case, a request to /content/non-existing-image.png will often returns 
the HTML error page, even if the browser indicated in the accept header, that 
it won't handle text/html  for this request. Next to potential security 
problems this can cause performance problems if the creation of the error page 
is expensive.

We need to have a set of dedicated content-handlers, which handle those 
requests with a reasonable response body (empty is also totally fine) and also 
fast.


> SlingServletResolver: provide simple error handlers for non-HTML requests
> -------------------------------------------------------------------------
>
>                 Key: SLING-13413
>                 URL: https://issues.apache.org/jira/browse/SLING-13413
>             Project: Sling
>          Issue Type: Improvement
>            Reporter: Joerg Hoh
>            Priority: Major
>
> Right now, when a request to a non-HTML resource fails, the 
> DefaultErrorServlet is resolved, which in most cases is not built to 
> explicitly handle requests to non-HTML resources and therefor always returns 
> either JSON (if the accept header indicates JSON) or HTML for eveything else.
> In that case, a request to /content/non-existing-image.png will often returns 
> the HTML error page, even if the browser indicated in the accept header, that 
> it won't handle text/html  for this request. Next to potential security 
> problems this can cause performance problems if the creation of the error 
> page is expensive.
> We need to have a dedicated handling for non-JSON and non-HTML responses, 
> which just set the statuscode. No response body is required in these cases.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to