-
-
Notifications
You must be signed in to change notification settings - Fork 849
Description
Introduced in #1843 which introduces an alternative instead of middleware for error handling.
The "problem" here is that PSR-7 requests and responses are immutable. The ErrorHandler middleware basically passes on the request it received from the outside world to inner middleware. One of these middlewares extracts cookies, headers etc. from the response to determine the actor, which is then stored as a "request attribute" on the request. Once you add a new request attribute, you're creating a new request instance, though - which means the request instance known by the ErrorHandler is unchanged. This was a design decision when PSR-7 was created.
TL;DR: Request object passed to error handler is not the same instance as the one passed to middleware. Actor is unavailable.