Skip to content

Commit

Permalink
Merge pull request #154 from adongy/patch-1
Browse files Browse the repository at this point in the history
_getClientUrl() fixes with reverse proxies
  • Loading branch information
jfritschi committed Jul 13, 2015
2 parents 6f28d47 + 0af573c commit 74510ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/CAS/Client.php
Expand Up @@ -3507,7 +3507,8 @@ private function _getClientUrl()
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
// explode the host list separated by comma and use the first host
$hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
$server_url = $hosts[0];
// see rfc7239#5.3 and rfc7230#2.7.1: port is in HTTP_X_FORWARDED_HOST if non default
return $hosts[0];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
$server_url = $_SERVER['HTTP_X_FORWARDED_SERVER'];
} else {
Expand Down

0 comments on commit 74510ae

Please sign in to comment.