From ba000d0e086155e8678e013215bf1bec3deadb6e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 1 Oct 2018 00:01:33 +0200 Subject: Better support for HTTP_X_FORWARDED_PROTO (#2037) https://github.com/FreshRSS/FreshRSS/issues/2031 --- lib/Minz/Request.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Minz/Request.php') 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 { -- cgit v1.2.3