diff --git a/config/bootstrap.php b/config/bootstrap.php index c57f81374..55918ba20 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -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