Skip to content

Commit

Permalink
move CORS preflight to ApiController
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <[email protected]>
  • Loading branch information
Chartman123 committed Oct 15, 2024
1 parent 30ba7c4 commit 5f0a026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
38 changes: 0 additions & 38 deletions appinfo/routes.php

This file was deleted.

9 changes: 9 additions & 0 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ public function __construct(
$this->currentUser = $userSession->getUser();
}

// CORS preflight
/**
* Handle CORS options request by calling parent function
*/
#[ApiRoute(verb: 'OPTIONS', url: Constants::API_BASE . '{path}', requirements: ['path' => '.+', 'apiVersion' => 'v3'])]

Check warning on line 107 in lib/Controller/ApiController.php

View check run for this annotation

Codecov / codecov/patch

lib/Controller/ApiController.php#L107

Added line #L107 was not covered by tests
public function preflightedCors() {
parent::preflightedCors();

Check warning on line 109 in lib/Controller/ApiController.php

View check run for this annotation

Codecov / codecov/patch

lib/Controller/ApiController.php#L109

Added line #L109 was not covered by tests
}

// API v3 methods
// Forms
/**
Expand Down

0 comments on commit 5f0a026

Please sign in to comment.