From c678bd14b58563fefb9258e717a82242c5cec881 Mon Sep 17 00:00:00 2001 From: dohodin Date: Thu, 30 Mar 2023 13:19:46 +0200 Subject: [PATCH] Try to get the container name 5 --- Source/Config/config.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Config/config.php b/Source/Config/config.php index 4581a88..085223a 100644 --- a/Source/Config/config.php +++ b/Source/Config/config.php @@ -14,10 +14,14 @@ $views['thanks'] = 'Views/HTML/thanks.php'; $views['error'] = 'Views/HTML/error.php'; $_SERVER['BASE_URI'] = ''; -$url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; -echo "URL : ".$url; + +$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"; +$url = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; +echo $url; + +echo "URL : ".$url." "; $newUrl=parse_url($url, PHP_URL_PATH); -echo "NewURL : ".$newUrl; +echo "NewURL : ".$newUrl." "; $container_name = basename($newUrl); echo "Container : ".$container_name;