<?php

$allowedOrigins = [
    'https://el3ab-player.caprover.al-arcade.com',
    'https://el3ab.caprover.al-arcade.com',
    'http://localhost:3000',
    'http://localhost:8080'
];
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
if (in_array($origin, $allowedOrigins, true)) {
    header('Access-Control-Allow-Origin: ' . $origin);
} else {
    header('Access-Control-Allow-Origin: https://el3ab-player.caprover.al-arcade.com');
}
header('Access-Control-Allow-Methods: GET, POST, DELETE, PUT, PATCH, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Authorization');
