Skip to content

Commit

Permalink
Update OpenIDConnectClient.php
Browse files Browse the repository at this point in the history
  • Loading branch information
c2theg authored Jul 13, 2017
1 parent e912382 commit c3ba743
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,13 @@ public function getRedirectURL() {
* Support of 'ProxyReverse' configurations.
*/

$protocol = @$_SERVER['HTTP_X_FORWARDED_PROTO']
?: @$_SERVER['REQUEST_SCHEME']
?: ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http");
if (isset($_SERVER["HTTP_UPGRADE_INSECURE_REQUESTS"]) && ($_SERVER['HTTP_UPGRADE_INSECURE_REQUESTS'] == 1)) {
$protocol = 'https';
} else {
$protocol = @$_SERVER['HTTP_X_FORWARDED_PROTO']
?: @$_SERVER['REQUEST_SCHEME']
?: ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http");
}

$port = @intval($_SERVER['HTTP_X_FORWARDED_PORT'])
?: @intval($_SERVER["SERVER_PORT"])
Expand Down

0 comments on commit c3ba743

Please sign in to comment.