From ca6954936f42179767b2a17e56a53dd7a92677f4 Mon Sep 17 00:00:00 2001 From: Timothy 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}"; }