]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[fix] Add support for X-Forwarded-Proto header field #413
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Mon, 3 Feb 2014 11:46:09 +0000 (12:46 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Mon, 3 Feb 2014 11:46:09 +0000 (12:46 +0100)
inc/poche/Tools.class.php

index 248a44d763d5d86719a949e977b802e58d20d29a..515a08aac294567e2e5b223a7b7bd81205b51d2b 100644 (file)
@@ -43,7 +43,9 @@ class Tools
             || (isset($_SERVER["SERVER_PORT"])
                     && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection.
             || (isset($_SERVER["SERVER_PORT"]) //Custom HTTPS port detection 
-                    && $_SERVER["SERVER_PORT"] == SSL_PORT);
+                    && $_SERVER["SERVER_PORT"] == SSL_PORT)
+             || (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
+                    && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');
 
         $serverport = (!isset($_SERVER["SERVER_PORT"])
             || $_SERVER["SERVER_PORT"] == '80'