mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
chore: add logging
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user