Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-16 22:25:10 +0100
committerErich Eckner <git@eckner.net>2019-01-16 22:25:10 +0100
commit8edcb155d057378cefcf830b862f4619a1764cef (patch)
tree0a8112a8826b4027b290abfe9421639976654856
parentd73640dfd1d252fe16ef9d3091c3eaaf5bbd6bab (diff)
packages/pkginfo.php: do not break if reverse-proxied
-rw-r--r--packages/pkginfo.php5
1 files changed, 4 insertions, 1 deletions
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';