Add protocol

This commit is contained in:
Matej Bačo
2024-10-28 15:24:34 +01:00
parent dc8b9478ee
commit 54b07e6b99
@@ -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')
};