options('/.*', function () { global $CORS; $preflight = \classes\cors_policy::preflightResponse($_SERVER['HTTP_ORIGIN'] ?? '', (string)($CORS ?? '')); \classes\cors_policy::emitHeaders($preflight['headers']); http_response_code($preflight['status']); echo $preflight['body']; }); } }