From ff6753854378d5701d460b7324de455753fe4ca3 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 28 Jan 2022 14:43:03 +0100 Subject: [PATCH] remove the port from domain (SiteRequest) --- core/Site/SiteRequest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Site/SiteRequest.php b/core/Site/SiteRequest.php index 07cf2ee..e127eeb 100644 --- a/core/Site/SiteRequest.php +++ b/core/Site/SiteRequest.php @@ -69,7 +69,9 @@ class SiteRequest public function getDomain(): string { - return $this->requestStack->getCurrentRequest()->headers->get('host'); + $host = $this->requestStack->getCurrentRequest()->headers->get('host'); + + return preg_replace('/:\d+$/', '', $host); } public function getUri(): string