cziegeler opened a new pull request, #106:
URL: https://github.com/apache/sling-org-apache-sling-engine/pull/106

   [SLING-13355](https://issues.apache.org/jira/browse/SLING-13355)
   
   ## Changes
   
   - `JakartaErrorHandler` services with the property `sling.error.handler` are 
bound as *named* error handlers. The existing default error handler reference 
now excludes them via its target filter, so a named handler never replaces the 
default one.
   - Handlers named `nonhtml` are used for requests that do not accept HTML. If 
several are registered, the highest ranked one wins.
   - Whether a request accepts HTML is determined by the `Accept` header only:
     - `text/html` or `*/*` → default error handler
     - missing/blank header, `text/*`, or anything else → non-HTML handler (if 
registered, otherwise the default one)
     - Request parameters (e.g. `:http-equiv-accept`) are deliberately not 
evaluated, as parameter parsing may be the cause of the error being handled.
   - New `DefaultNonHtmlErrorHandler` component: sends the status with an empty 
body.
   
   ## Tests
   
   - `DefaultErrorHandlerTest`: routing by `Accept` header, fallbacks, name 
matching (incl. multi-valued), ranking and tie-breaking, dynamic removal, 
failing delegate, parameters not read.
   - `DefaultNonHtmlErrorHandlerTest`: status only, empty body.
   - `SlingRequestProcessorImplTest`: DS wiring via OSGi Mock (reference target 
filters, dynamic binding, the real `DefaultNonHtmlErrorHandler` component).
   
   ## Open TODOs
   
   `sling.error.handler` and `nonhtml` constants should move to the Sling API.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to