Skip to content

Commit

Permalink
Add Access-Control-Allow-Methods header
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schindler committed Feb 24, 2022
1 parent fe2d6b6 commit 88d5209
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Backend/Core/System/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 88d5209

Please sign in to comment.