add CORS header in community server

This commit is contained in:
einhornimmond 2021-03-02 13:46:12 +01:00 committed by Ulf Gebhardt
parent 7543308c9e
commit 9ae9e5c311
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -193,6 +193,13 @@ Type::build('datetime')
->useImmutable();
Type::build('timestamp')
->useImmutable();
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
exit(0);
}
/*
* Custom Inflector rules, can be set to correctly pluralize or singularize