From 89766246ebcb070f85c3af27f165e4fc513e0cb2 Mon Sep 17 00:00:00 2001 From: Mathieu Ducrot Date: Wed, 28 Aug 2024 11:30:38 +0200 Subject: [PATCH] Add .sso subdomain for RequestUtils::getContextFromHost for proper detection on localhost --- src/Utils/RequestUtils.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Utils/RequestUtils.php b/src/Utils/RequestUtils.php index a962a0a..7426cdc 100644 --- a/src/Utils/RequestUtils.php +++ b/src/Utils/RequestUtils.php @@ -16,11 +16,12 @@ public static function getContextFromHost(string $host, ?string $domain = null): // MDT fallback in case there is no subdomain and the host is different from the domain $toReturn = 'app'; if ( - str_starts_with($host, 'app.') || - str_starts_with($host, 'admin.') || - str_starts_with($host, 'api.') || - str_starts_with($host, 'extranet.') || - substr_count($host, '.') > 1 + str_starts_with($host, 'app.') + || str_starts_with($host, 'admin.') + || str_starts_with($host, 'api.') + || str_starts_with($host, 'extranet.') + || str_starts_with($host, 'sso.') + || substr_count($host, '.') > 1 ) { $toReturn = substr($host, 0, (int) strpos($host, '.')); }