Merge pull request #5805 from WoltLab/service-worker-notifications
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / action / CoreRewriteTestAction.class.php
index 46c106b116060e842dd294e08eda8c9f0e430766..cabcd15279a4c0dcc69a5453f287da091e21897f 100644 (file)
@@ -3,7 +3,7 @@
 namespace wcf\action;
 
 use Laminas\Diactoros\Response\JsonResponse;
-use wcf\system\exception\IllegalLinkException;
+use wcf\util\HeaderUtil;
 
 /**
  * Internal action used to run a test for url rewriting.
@@ -17,20 +17,6 @@ final class CoreRewriteTestAction extends AbstractAction
 {
     const AVAILABLE_DURING_OFFLINE_MODE = true;
 
-    /**
-     * @inheritDoc
-     *
-     * @throws      IllegalLinkException
-     */
-    public function readParameters()
-    {
-        parent::readParameters();
-
-        if (!isset($_GET['uuidHash']) || !\hash_equals(\hash('sha256', WCF_UUID), $_GET['uuidHash'])) {
-            throw new IllegalLinkException();
-        }
-    }
-
     /**
      * @inheritDoc
      */
@@ -38,14 +24,11 @@ final class CoreRewriteTestAction extends AbstractAction
     {
         parent::execute();
 
-        return new JsonResponse(
+        return HeaderUtil::withNoCacheHeaders(new JsonResponse(
             [
                 'core_rewrite_test' => 'passed',
             ],
             200,
-            [
-                'access-control-allow-origin' => '*',
-            ]
-        );
+        ));
     }
 }