feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic
This commit is contained in:
parent
ca57082f01
commit
c021ea54ae
140 changed files with 1001 additions and 985 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue