diff --git a/index.php b/index.php index 7d291f18..4bf391a1 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,7 @@ $dsn = ''; $clients = []; +$allow_cors = 0; /** * The MIT License @@ -544,6 +545,9 @@ public static function Reply($data) if (headers_sent() !== true) { + if ($allow_cors) { + header('Access-Control-Allow-Origin: *'); + } header(sprintf('Content-Type: application/%s; charset=utf-8', (empty($callback) === true) ? 'json' : 'javascript')); } }