Skip to content

Commit

Permalink
remove closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusPC committed Oct 25, 2021
1 parent 4fcb64e commit ca4fb14
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,9 @@ public function getRedirectURL() {
* Support of 'ProxyReverse' configurations.
*/

if ($this->httpUpgradeInsecureRequests
&& 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');
}
$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 All @@ -638,8 +631,8 @@ public function getRedirectURL() {
?: @$_SERVER['SERVER_ADDR'];

$port = (443 === $port) || (80 === $port) ? '' : ':' . $port;
$uriSplit = explode("?", $_SERVER['REQUEST_URI']);
$uriSplit = explode("?", $_SERVER['REQUEST_URI']);

return sprintf('%s://%s%s/%s', $protocol, $host, $port, @trim(reset($uriSplit), '/'));
}
Expand Down Expand Up @@ -1356,15 +1349,6 @@ public function setVerifyHost($verifyHost) {
}


/**
* Controls whether http header HTTP_UPGRADE_INSECURE_REQUESTS should be considered
* defaults to true
* @param bool $httpUpgradeInsecureRequests
*/
public function setHttpUpgradeInsecureRequests($httpUpgradeInsecureRequests) {
$this->httpUpgradeInsecureRequests = $httpUpgradeInsecureRequests;
}

/**
* @return bool
*/
Expand All @@ -1379,14 +1363,6 @@ public function getVerifyPeer() {
return $this->verifyPeer;
}

/**
* @return bool
*/
public function getHttpUpgradeInsecureRequests()
{
return $this->httpUpgradeInsecureRequests;
}

/**
* Use this for custom issuer validation
* The given function should accept the issuer string from the JWT claim as the only argument
Expand Down

0 comments on commit ca4fb14

Please sign in to comment.