From 54b07e6b99c8a661e1fd9558341b1bc5766bb598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 28 Oct 2024 15:24:34 +0100 Subject: [PATCH] Add protocol --- src/Appwrite/Platform/Modules/Functions/Workers/Builds.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 72390a7668..a528a14c02 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -989,9 +989,10 @@ class Builds extends Action Query::equal("resourceInternalId", [$deployment->getInternalId()]) ])); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; $previewUrl = match($resource->getCollection()) { 'functions' => '', - 'sites' => !empty($rule) ? $rule->getAttribute('domain', '') : '', + 'sites' => !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : '', default => throw new \Exception('Invalid resource type') };