Merge pull request #5805 from WoltLab/service-worker-notifications
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / action / CoreRewriteTestAction.class.php
index c29ec20a2121dad8a4b4a147a67b9ca4989bce49..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.
@@ -11,27 +11,12 @@ use wcf\system\exception\IllegalLinkException;
  * @author  Alexander Ebert
  * @copyright   2001-2019 WoltLab GmbH
  * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\Action
  * @since       3.1
  */
-class CoreRewriteTestAction extends AbstractAction
+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
      */
@@ -39,14 +24,11 @@ class CoreRewriteTestAction extends AbstractAction
     {
         parent::execute();
 
-        return new JsonResponse(
+        return HeaderUtil::withNoCacheHeaders(new JsonResponse(
             [
                 'core_rewrite_test' => 'passed',
             ],
             200,
-            [
-                'access-control-allow-origin' => '*',
-            ]
-        );
+        ));
     }
 }