Skip to content

Commit 12b801d

Browse files
committed
handle https for proxies like nginx
1 parent faee1ee commit 12b801d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,9 @@ function require_version($version) {
896896
}
897897

898898
function get_protocol($forceSsl = false) {
899-
$https = \GLFramework\Globals\Server::get('HTTPS', false) || $forceSsl;
899+
$native = \GLFramework\Globals\Server::get('HTTPS', false) || $forceSsl;
900+
$proxy = \GLFramework\Globals\Server::get('HTTP_X_FORWARDED_PROTO', false);
901+
$https = $native || $proxy;
900902
return ($https?"https":"http");
901903
}
902904

0 commit comments

Comments
 (0)