Files
tools/.hta_config/conf.php
2026-01-27 12:56:41 +05:30

34 lines
655 B
PHP

<?php
/**
* Global API Headers Configuration
*/
$API_HEADERS = [
'Content-Type: application/json; charset=utf-8',
'Access-Control-Allow-Origin: *',
'Access-Control-Allow-Methods: POST, OPTIONS',
'Access-Control-Allow-Headers: Content-Type, Authorization',
'X-Powered-By: SiliconPin Tools'
];
/**
* Apply headers helper
*/
function applyApiHeaders(array $headers): void
{
foreach ($headers as $header) {
header($header);
}
}
/**
* Handle CORS preflight globally
*/
function handleCorsPreflight(): void
{
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
}