Skip to content

Commit

Permalink
detect HTTPS from proxies
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and timar committed Sep 8, 2020
1 parent 2853189 commit f835f33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ function getallheaders()
exit();
}
// URL into this server of the proxy script.
if (isset($_SERVER['HTTPS'])) {
if ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' )
|| (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on')
) {
$proxyURL = "https://";
} else {
$proxyURL = "http://";
Expand Down

0 comments on commit f835f33

Please sign in to comment.