Update: 2026-05-15 15:45:48
This commit is contained in:
@@ -40,12 +40,12 @@ if (!$envLoaded) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security: API Key Validation
|
// Security: API Key Validation
|
||||||
$expectedApiKey = $_ENV['API_KEY'] ?? 'JORDAN_BOT_SECRET_2026';
|
$expectedApiKey = $_SERVER['API_KEY'] ?? (getenv('API_KEY') ?: ($_ENV['API_KEY'] ?? 'JORDAN_BOT_SECRET_2026'));
|
||||||
$headers = getallheaders();
|
$headers = getallheaders();
|
||||||
$providedKey = $headers['X-API-Key'] ?? ($headers['x-api-key'] ?? null);
|
$providedKey = $headers['X-API-Key'] ?? ($headers['x-api-key'] ?? null);
|
||||||
|
|
||||||
// Debug Logging
|
// Enhanced Debug Logging
|
||||||
error_log("JordanBot API Check: Provided Key: [$providedKey], Expected Key (from ENV): [" . ($_ENV['API_KEY'] ?? 'NULL') . "], Fallback: [JORDAN_BOT_SECRET_2026]");
|
error_log("JordanBot API Check: Provided: [$providedKey], Expected: [$expectedApiKey], EnvLoaded: [" . ($envLoaded ? "YES" : "NO") . "]");
|
||||||
|
|
||||||
if ($providedKey !== $expectedApiKey) {
|
if ($providedKey !== $expectedApiKey) {
|
||||||
http_response_code(401);
|
http_response_code(401);
|
||||||
|
|||||||
Reference in New Issue
Block a user