diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 978c0bd2b5..915335f1c2 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1282,7 +1282,6 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->inject('request') ->inject('response') ->action(function (string $projectId, string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response) { - $domain = $request->getHostname(); $protocol = $request->getProtocol(); diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index 8fd2120042..e7c4069569 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -46,8 +46,6 @@ class Origin extends Validator Console::info('Origin: ' . $origin); Console::info('Hostnames: ' . json_encode($this->hostnames, JSON_PRETTY_PRINT)); Console::info('Host: ' . $this->host); - $validator = new Hostname($this->hostnames); - Console::info('Valid Hostname? ' . $validator->isValid($this->host) ? 'Yes' : 'No'); Console::info('Schemes: ' . json_encode($this->schemes, JSON_PRETTY_PRINT)); Console::info('Scheme: ' . $this->scheme); @@ -55,10 +53,16 @@ class Origin extends Validator return true; } + Console::info('we got here (1)'); + if (!in_array($this->scheme, ['http', 'https'])) { return false; } + Console::info('we got here (2)'); + + $validator = new Hostname($this->hostnames); + Console::info('Valid Hostname? ' . ($validator->isValid($this->host) ? 'Yes' : 'No')); return $validator->isValid($this->host); }