From 8edcb155d057378cefcf830b862f4619a1764cef Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 16 Jan 2019 22:25:10 +0100 Subject: packages/pkginfo.php: do not break if reverse-proxied --- packages/pkginfo.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 0939b8e..2081bbc 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -17,7 +17,10 @@ require_once BASE . "/lib/style.php"; $tld = explode('.', $_SERVER['HTTP_HOST']); end($tld); $tld = current($tld); - if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on')) + if ((array_key_exists('HTTPS', $_SERVER) && + ($_SERVER['HTTPS'] == 'on')) || + (array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER) && + ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))) $protocol = 'https'; else $protocol = 'http'; -- cgit v1.2.3-70-g09d2