Task #83724

Epic #83894: PSR-15 Initiative

HTTP RequestHandlers should always return a PSR-7 ResponseInterface, not NULL

Added by Benjamin Franzke almost 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2018-01-29
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The PSR-15 middleware interfaces [1] require that RequestHandlers always return a Response.
In order to support PSR-15 middleware (at some point), TYPO3 request handlers should do the same.

A NULL return value should rather be replaced with a PSR-7 Response that's either ignored by Core\Bootstrap or a Response with a 200 status code and an empty body.

[1] https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md


Related issues

Related to TYPO3 Core - Feature #83725: Introduce PSR-15 HTTP Middleware support Closed 2018-01-29
Related to TYPO3 Core - Task #83726: HTTP RequestHandlers should use strict typing Closed 2018-01-29

Associated revisions

Revision 123846c0 (diff)
Added by Benjamin Franzke almost 2 years ago

[TASK] Ensure HTTP RequestHandlers always return a PSR-7 Repsonse

This is in preparation for PSR-15 middleware support which
will require PSR-7 RespnseInterface return type declarations
for request handlers.

As TSFE powers a concept of outputting nothing [see isOutputting()]
we need to add NullResponse (which implements the PSR-7 ResponseInterface)
which Core/Bootstrap can detect, to stop invoking header() and echo.

Change-Id: Ie3169a4365a85d0472523138cc73bb47cbbcb70f
Releases: master
Resolves: #83724
Reviewed-on: https://review.typo3.org/55498
Tested-by: TYPO3com <>
Reviewed-by: Mathias Brodala <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Tested-by: Susanne Moog <>

History

#1 Updated by Benjamin Franzke almost 2 years ago

  • Related to Feature #83725: Introduce PSR-15 HTTP Middleware support added

#2 Updated by Benjamin Franzke almost 2 years ago

  • Related to Task #83726: HTTP RequestHandlers should use strict typing added

#3 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#4 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#5 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#6 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#7 Updated by Gerrit Code Review almost 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#8 Updated by Gerrit Code Review almost 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#9 Updated by Gerrit Code Review almost 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#10 Updated by Gerrit Code Review almost 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#11 Updated by Gerrit Code Review almost 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55498

#12 Updated by Benjamin Franzke almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#13 Updated by Susanne Moog almost 2 years ago

  • Parent task set to #83894

#14 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF