fix: add back empty checks

This commit is contained in:
Chirag Aggarwal
2025-06-30 19:48:05 +05:30
parent 843d4d9ea0
commit db56361ad9
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1035,6 +1035,7 @@ App::init()
if (
$devKey->isEmpty()
&& !empty($origin)
&& !$originValidator->isValid($origin)
&& \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE])
&& $route->getLabel('origin', false) !== '*'
+1 -1
View File
@@ -559,7 +559,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server,
$origin = $request->getOrigin();
$originValidator = new Origin($platforms);
if (!$originValidator->isValid($origin) && $project->getId() !== 'console') {
if (!empty($origin) && !$originValidator->isValid($origin) && $project->getId() !== 'console') {
throw new Exception(Exception::REALTIME_POLICY_VIOLATION, $originValidator->getDescription());
}