chore: add logging

This commit is contained in:
Chirag Aggarwal
2025-07-03 21:17:43 +05:30
parent bb9a271fa8
commit 4747700eae
2 changed files with 6 additions and 1 deletions
-1
View File
@@ -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);
@@ -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;