From 72f08e281bc8878936889a1352b803c0bce781c5 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 3 Jul 2025 22:39:12 +0530 Subject: [PATCH] chore: make check consistent --- src/Appwrite/Network/Platform.php | 1 + src/Appwrite/Network/Validator/Origin.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Network/Platform.php b/src/Appwrite/Network/Platform.php index 71b4587824..d584ec074f 100644 --- a/src/Appwrite/Network/Platform.php +++ b/src/Appwrite/Network/Platform.php @@ -113,6 +113,7 @@ class Platform case self::TYPE_WEB: case self::TYPE_FLUTTER_WEB: $schemes[] = self::SCHEME_HTTP; + $schemes[] = self::SCHEME_HTTPS; break; case self::TYPE_FLUTTER_IOS: case self::TYPE_APPLE_IOS: diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index 59e06a8ea4..6cd212af2f 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -43,7 +43,7 @@ class Origin extends Validator $this->host = strtolower(parse_url($origin, PHP_URL_HOST) ?? ''); $validator = new Hostname($this->hostnames); - if (in_array($this->scheme, ['http', 'https']) && $validator->isValid($this->host)) { // Valid HTTP/HTTPS origin + if (in_array($this->scheme, [Platform::SCHEME_HTTP, Platform::SCHEME_HTTPS]) && $validator->isValid($this->host)) { // Valid HTTP/HTTPS origin return true; }