From 88d5209045d89c929c127490e9bd272e3a91bbee Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 24 Feb 2022 22:45:42 +0100 Subject: [PATCH] Add Access-Control-Allow-Methods header --- Backend/Core/System/Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Backend/Core/System/Controller.php b/Backend/Core/System/Controller.php index 814df55..e7110c8 100644 --- a/Backend/Core/System/Controller.php +++ b/Backend/Core/System/Controller.php @@ -87,6 +87,7 @@ protected function redirect(string $url): never { * @return int HTTP status code (200 === OK!) */ private function checkAccess(): int { + header('Access-Control-Allow-Methods: ' . implode(', ', array_merge($this->methods, ['OPTIONS', 'HEAD']))); if (empty(array_intersect(['*', 'OPTIONS', 'HEAD', IO::method()], $this->methods))) return 405; if ($this->userRequired)