Skip to content

Commit

Permalink
Fix forwarded host determination
Browse files Browse the repository at this point in the history
Use X-Forwarded-Host if set instead of X-Forwarded-Server to match domain, see yakamara#552
  • Loading branch information
wv-leifel authored Oct 5, 2024
1 parent 4115749 commit 0c4d840
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/yrewrite/yrewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ public static function getFullPath($link = '')

public static function getHost()
{
if (isset($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
return $_SERVER['HTTP_X_FORWARDED_SERVER'];
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
return $_SERVER['HTTP_X_FORWARDED_HOST'];
}
return @$_SERVER['HTTP_HOST'];
}
Expand Down

0 comments on commit 0c4d840

Please sign in to comment.