[FEATURE] Add support for PSR-15 HTTP middlewares 28/55528/15
authorBenni Mack <benni@typo3.org>
Sat, 3 Feb 2018 20:03:58 +0000 (21:03 +0100)
committerBenni Mack <benni@typo3.org>
Sat, 3 Feb 2018 20:56:55 +0000 (21:56 +0100)
commitf22792eceea631b8f01fbe0fcbf3e62b52246cad
tree5833cc0c86adedbacc60db21eb127cdb26d5314b
parentd02438773a2107d0cf4659af8cc20b55d18d6841
[FEATURE] Add support for PSR-15 HTTP middlewares

PSR-15 middlewares are hooks on steroids for HTTP requests.
Due to chaining middlewares and the core request handler(s),
middlewares can execute code before and after the application.

Middlewares may return early, that means they can prevent
consecutive middleware and the core application from being executed
at all.

A full middleware coverage for *all* requests will need
a lot of changes to the core and extensions.
We'll eventually need to stop using header()/exit()/die()
or HttpUtility::{redirect,sendRespose}(). Those method calls
need to be replaced by manipulation of PSR-7 message objects.

Change-Id: I075639835115f7cf28f18c3814ef6dd190fdf29b
Releases: master
Resolves: #83725
Reviewed-on: https://review.typo3.org/55528
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
13 files changed:
composer.json
composer.lock
typo3/sysext/backend/Classes/Http/AjaxRequestHandler.php
typo3/sysext/backend/Classes/Http/Application.php
typo3/sysext/backend/Classes/Http/RequestHandler.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-83725-SupportForPSR-15HTTPMiddlewares.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Http/Fixtures/MiddlewareFixture.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Http/MiddlewareDispatcherTest.php [new file with mode: 0644]
typo3/sysext/frontend/Classes/Http/Application.php
typo3/sysext/frontend/Classes/Http/EidRequestHandler.php
typo3/sysext/frontend/Classes/Http/RequestHandler.php