PerlDancer/Dancer2 — pull request #718 by veryrusty (2014-10-07 03:03:39+00:00)
Title: Add request attribute to all engines

Prior to the great context removal, engines had access to the request object via the context. Several engines used this, such as Serializer::Mutable and (non-core) Session::PSGI. Part of the context removal involved workarounds to keep those functioning e.g. populating `extra_headers` for the mutable serializer.
Some non-core engines that require access to the request (specifically the PSGI env) have been broken since.
This Pr adds a request attribute to Role::Engine to recover the former functionality.

The work to make apps responsible for their own dispatching made populating the attribute easy (i.e. made it obvious where the attribute needed to be set and cleared). The `extra_headers` hack has been removed and the template engine no longer passes the request object around between methods (as it was prior to the context object removal).

Dancer2::Session::PSGI has also been tested against this Pr to verify this restores its functionality.