Skip to content
Snippets Groups Projects
Commit 03c29a88 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Benjamin Franzke
Browse files

[TASK] Use PSR-17 StreamFactoryInterface in ActionController

The extbase ActionController is already using the
PSR-17 ResponseFactoryInterface for creating PSR-7
responses. The body however was still set in a
PSR-7 "fashion". This is now changed to also use
PSR-17 for setting the response body. More precisly,
the PSR-17 StreamFactoryInterface is used explicitly
instead of letting the body stream be created implicity
by getBody().

The PSR-17 StreamFactoryInterface is therefore
from now on available in every extbase action controller.

Besides the `createStream` method, the interface
also features `createStreamFromResource` and
`createStreamFromFile` methods. The latter is really useful
for responses that contains files, e.g. a ZIP download.

This also adjusts the corresponding changelogs
and replaces examples, which used the internal
`HtmlResponse` class.

Resolves: #95170
Releases: master
Change-Id: Ib35046c061afbbc371bec0461953a55720583dee
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70986


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarJochen <rothjochen@gmail.com>
Tested-by: default avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarJochen <rothjochen@gmail.com>
Reviewed-by: default avatarBenjamin Franzke <bfr@qbus.de>
parent 77b940e9
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment