Update the CORS configuration

This commit is contained in:
Alex Tselegidis 2023-08-02 19:08:24 +02:00
parent 007145e213
commit 93e53649cb
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,9 @@ header('X-Frame-Options: SAMEORIGIN');
| |
*/ */
header('Access-Control-Allow-Origin: *'); // NOTICE: Change this header to restrict CORS access. header('Access-Control-Allow-Origin: ' . ($_SERVER['HTTP_ORIGIN'] ?? '*')); // NOTICE: Change this header to restrict CORS access.
header('Access-Control-Allow-Credentials: "true"');
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
{ {