summaryrefslogtreecommitdiff
path: root/include/sanity_check.php
diff options
context:
space:
mode:
authorfox <[email protected]>2017-07-10 12:38:08 +0000
committerGogs <[email protected]>2017-07-10 12:38:08 +0000
commit1003cb24b99aa72f0d37c93ede4053f9d65849cf (patch)
treefef738f8995a31573388c1b1ac21a141e87f78ed /include/sanity_check.php
parentbe61f1c45c45376a32cb72e2500a4bd633c83e17 (diff)
parent643ebe4229249a5c3d1d7f584880ae7c35aa30b6 (diff)
Merge branch 'x_forwarded_proto' of yastupin/tt-rss into master
Diffstat (limited to 'include/sanity_check.php')
-rwxr-xr-xinclude/sanity_check.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sanity_check.php b/include/sanity_check.php
index 2f5315edf..ea7b0da80 100755
--- a/include/sanity_check.php
+++ b/include/sanity_check.php
@@ -15,7 +15,8 @@
* to get out. */
function make_self_url_path() {
- $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+ $proto = ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http';
+ $url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
return $url_path;
}