aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Request.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-10-01 00:01:33 +0200
committerGravatar GitHub <noreply@github.com> 2018-10-01 00:01:33 +0200
commitba000d0e086155e8678e013215bf1bec3deadb6e (patch)
tree152a8dceecd6e81a19fb6054a509d69ae4acf2c2 /lib/Minz/Request.php
parente21585e6995fbe9505bc5bb1cc949139bbe25081 (diff)
Better support for HTTP_X_FORWARDED_PROTO (#2037)
https://github.com/FreshRSS/FreshRSS/issues/2031
Diffstat (limited to 'lib/Minz/Request.php')
-rw-r--r--lib/Minz/Request.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index e21697e42..24e30546f 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -129,6 +129,8 @@ class Minz_Request {
if (!empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$port = intval($_SERVER['HTTP_X_FORWARDED_PORT']);
+ } elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+ $port = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https' ? 443 : 80;
} elseif (!empty($_SERVER['SERVER_PORT'])) {
$port = intval($_SERVER['SERVER_PORT']);
} else {