From 781e046714c72a490eb3376631a1bd8938362a31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 6 Aug 2021 15:51:37 +0200 Subject: [PATCH] Use PSR-7 responses in CoreRewriteTestAction --- .../lib/action/CoreRewriteTestAction.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/action/CoreRewriteTestAction.class.php b/wcfsetup/install/files/lib/action/CoreRewriteTestAction.class.php index 5308d7ef09..c29ec20a21 100644 --- a/wcfsetup/install/files/lib/action/CoreRewriteTestAction.class.php +++ b/wcfsetup/install/files/lib/action/CoreRewriteTestAction.class.php @@ -2,8 +2,8 @@ namespace wcf\action; +use Laminas\Diactoros\Response\JsonResponse; use wcf\system\exception\IllegalLinkException; -use wcf\util\JSON; /** * Internal action used to run a test for url rewriting. @@ -39,10 +39,14 @@ class CoreRewriteTestAction extends AbstractAction { parent::execute(); - \header('Access-Control-Allow-Origin: *'); - \header('Content-type: application/json; charset=UTF-8'); - echo JSON::encode(['core_rewrite_test' => 'passed']); - - exit; + return new JsonResponse( + [ + 'core_rewrite_test' => 'passed', + ], + 200, + [ + 'access-control-allow-origin' => '*', + ] + ); } } -- 2.20.1