Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 11 Apr 2018 21:29:28 +0000 (23:29 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 11 Apr 2018 21:29:28 +0000 (23:29 +0200)
- better detection of HTTP(S)

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/bootstrap/class_FrameworkBootstrap.php

index d7379e5..490e407 100644 (file)
@@ -477,7 +477,21 @@ final class FrameworkBootstrap {
         * @todo        Test more fields
         */
        public static function isHttpSecured () {
-               return (isset($_SERVER['HTTPS']));
+               return (
+                       (
+                               (
+                                       isset($_SERVER['HTTPS'])
+                               ) && (
+                                       strtolower($_SERVER['HTTPS']) == 'on'
+                               )
+                       ) || (
+                               (
+                                       isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
+                               ) && (
+                                       strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'
+                               )
+                       )
+               );
        }
 
        /**