Update: 2026-06-29 00:07:33

This commit is contained in:
Hamza-Ayed
2026-06-29 00:07:33 +03:00
parent 24da2bc7ca
commit d695a4e812
15 changed files with 190 additions and 60 deletions

View File

@@ -5,6 +5,21 @@
// ============================================================
require_once __DIR__ . '/core/bootstrap.php';
// --------- تحقق من تطابق المنطقة (Region Mismatch Guard) ---------
$requestHost = $_SERVER['HTTP_HOST'] ?? '';
$appDomain = getenv('APP_DOMAIN') ?: '';
if (!empty($appDomain) && !empty($requestHost) && strtolower($requestHost) !== strtolower($appDomain)) {
if ($requestHost !== 'localhost' && !preg_match('/^127\.0\.0\./', $requestHost)) {
http_response_code(400);
exit(json_encode([
'status' => 'failure',
'error_code' => 'REGION_MISMATCH',
'message' => "Region mismatch: Request host '$requestHost' does not match server domain '$appDomain'."
]));
}
}
require_once __DIR__ . '/functions.php';
// 1. Rate Limiting and JWT Authentication