From eaf3554611e18a08466dac662c60642dc8113c28 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 10 Oct 2018 15:58:28 -0400 Subject: [PATCH] Attempt to fix ssl detection --- src/UrlGenerator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/UrlGenerator.php b/src/UrlGenerator.php index 92880de1..f3d8e39e 100644 --- a/src/UrlGenerator.php +++ b/src/UrlGenerator.php @@ -88,7 +88,9 @@ class UrlGenerator extends RoutingBase { } $path = implode('/', $path_segments); - $scheme = (isset($_SERVER['HTTPS'])) ? 'https:' : 'http:'; + $isHttps = $_SERVER['SERVER_PORT'] === '443' || isset($_SERVER['HTTPS']); + + $scheme = ($isHttps) ? 'https:' : 'http:'; return "{$scheme}//{$this->host}/{$path}"; }