From 4747700eaed9ef970477923e2b71015727430d22 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 3 Jul 2025 21:17:43 +0530 Subject: [PATCH] chore: add logging --- app/controllers/general.php | 1 - src/Appwrite/Network/Validator/Origin.php | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index ae5b17cee6..7d23c515e3 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -49,7 +49,6 @@ use Utopia\Logger\Log\User; use Utopia\Logger\Logger; use Utopia\Platform\Service; use Utopia\System\System; -use Utopia\Validator\Hostname; use Utopia\Validator\Text; Config::setParam('domainVerification', false); diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index 21563a9a15..7aa1bf278d 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -3,6 +3,7 @@ namespace Appwrite\Network\Validator; use Appwrite\Network\Platform; +use Utopia\CLI\Console; use Utopia\Validator; use Utopia\Validator\Hostname; @@ -42,6 +43,11 @@ class Origin extends Validator $this->scheme = $this->parseScheme($origin); $this->host = strtolower(parse_url($origin, PHP_URL_HOST) ?? ''); + Console::log("Scheme: " . $this->scheme); + Console::log("Host: " . $this->host); + Console::log("Hostnames: " . json_encode($this->hostnames, JSON_PRETTY_PRINT)); + Console::log("Schemes: " . json_encode($this->schemes, JSON_PRETTY_PRINT)); + $validator = new Hostname($this->hostnames); if (in_array($this->scheme, ['http', 'https']) && $validator->isValid($this->host)) { // Valid HTTP/HTTPS origin return true;