تحديث شامل للوحة التحكم وإضافة كافة الميزات للـ WebSidebar
This commit is contained in:
+5
-12
@@ -17,20 +17,13 @@ $allowedOrigins = array_filter([
|
||||
$requestOrigin = $_SERVER['HTTP_ORIGIN'] ?? '';
|
||||
if (!empty($requestOrigin)) {
|
||||
$isLocal = strpos($requestOrigin, 'http://localhost') === 0 || strpos($requestOrigin, 'http://127.0.0.1') === 0;
|
||||
if ($isLocal || in_array($requestOrigin, $allowedOrigins, true)) {
|
||||
header("Access-Control-Allow-Origin: " . $requestOrigin);
|
||||
} else {
|
||||
header("Access-Control-Allow-Origin: https://siromove.com");
|
||||
}
|
||||
|
||||
}
|
||||
header("Access-Control-Allow-Credentials: true");
|
||||
header("Access-Control-Allow-Methods: POST, OPTIONS");
|
||||
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
http_response_code(200);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ── Rate Limiting ───────────────────────────────────────────
|
||||
$limiter = new RateLimiter($redis);
|
||||
|
||||
Reference in New Issue
Block a user