mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 11:37:46 +02:00
fix(cors): add preflight option routes for episode, podcast and status objects
This commit is contained in:
parent
a09853ef14
commit
a281abfda4
3 changed files with 36 additions and 14 deletions
|
|
@ -210,19 +210,6 @@ class EpisodeController extends BaseController
|
|||
->setBody($podcastObject->toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function commentsPreflight(): Response
|
||||
{
|
||||
return $this->response->setHeader('Access-Control-Allow-Origin', '*') // for allowing any domain, insecure
|
||||
->setHeader('Access-Control-Allow-Headers', '*') // for allowing any headers, insecure
|
||||
->setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS') // allows GET and OPTIONS methods only
|
||||
->setHeader('Access-Control-Max-Age', '86400')
|
||||
->setHeader('Cache-Control', 'public, max-age=86400')
|
||||
->setStatusCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue