From 7b7596167a60cd7ca6db7fc59bcadb8b478f8328 Mon Sep 17 00:00:00 2001 From: jellykells <42573508+jellykells@users.noreply.github.com> Date: Thu, 23 Dec 2021 21:36:21 -0600 Subject: [PATCH] add support for x-forwarded-proto header --- core/util.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/util.php b/core/util.php index e0a26af7..8b20139d 100644 --- a/core/util.php +++ b/core/util.php @@ -65,6 +65,10 @@ function contact_link(): ?string */ function is_https_enabled(): bool { + // check forwarded protocol + if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { + $_SERVER['HTTPS']='on'; + } return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'); }