Review main Merged

69664[TASK] Add convenience method for extbase JSON responses

Oli Bartsch CR +2 V +2 Normal +72 −73 updated 06/30/21, 20:13

Commit message

Since #92784 extbase actions require to return a PSR-7 Response.
To ease the migration path, the convenience method htmlResponse()
was added. This method creates a new PSR-7 Response with the correct
header and status code. Furthermore, in case no $html content is
given explicitly, the current view is rendered and the result
passed as response body.

Extbase however also features the JsonView, which is widely
used in third-party extensions as well as in multiple core
controllers itself. Also TSFE has to be respected when adding
the content-type header with the correct charset. Therefore,
a new method jsonResponse(), with similar functionality to
htmlResponse(), is now added along with adaptations of all
places in core controllers.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 8