feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic

This commit is contained in:
Cory Dransfeldt 2025-06-13 16:31:36 -07:00
parent 7a0b808f24
commit 4d76a3ba1e
No known key found for this signature in database
138 changed files with 998 additions and 970 deletions

View file

@ -1,7 +1,6 @@
<?php
require __DIR__ . "/../vendor/autoload.php";
require __DIR__ . '/../server/utils/init.php';
require_once __DIR__ . '/../bootstrap.php';
use App\Classes\BaseHandler;
@ -20,7 +19,7 @@ class QueryHandler extends BaseHandler
$referer = $_SERVER['HTTP_REFERER'] ?? '';
$hostAllowed = fn($url) => in_array(parse_url($url, PHP_URL_HOST), $allowedHosts, true);
if (!$hostAllowed($origin) && !$hostAllowed($referer)) $this->sendErrorResponse("Forbidden invalid origin", 403);
if (!$hostAllowed($origin) && !$hostAllowed($referer)) $this->sendErrorResponse("Forbidden: invalid origin", 403);
$allowedSource = $origin ?: $referer;
$scheme = parse_url($allowedSource, PHP_URL_SCHEME) ?? 'https';