From 740419806eb44bd3c92d688fe7088e8350797544 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 14 Oct 2024 22:35:18 +0200 Subject: [PATCH] Refactor StartSentinel to ensure endpoint uses HTTPS --- app/Actions/Server/StartSentinel.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Actions/Server/StartSentinel.php b/app/Actions/Server/StartSentinel.php index a52fb4125..e7c613eb0 100644 --- a/app/Actions/Server/StartSentinel.php +++ b/app/Actions/Server/StartSentinel.php @@ -21,14 +21,12 @@ class StartSentinel $endpoint = InstanceSettings::get()->fqdn; if (isDev()) { $endpoint = 'http://host.docker.internal:8000'; - } else { - if (str($endpoint)->startsWith('http')) { - throw new \Exception('You should use https to run Sentinel.'); - } } if (! $endpoint) { throw new \Exception('You should set FQDN in Instance Settings.'); } + // Ensure the endpoint is using HTTPS + $endpoint = str($endpoint)->replace('http://', 'https://')->value(); $environments = [ 'TOKEN' => $token, 'ENDPOINT' => $endpoint,