Skip to content

Commit f0fba96

Browse files
authored
Merge pull request #13 from skyverge/valet-share-compat
Fix get_forwarded_host() when HTTP_X_FORWARDED_HOST is defined
2 parents 2200268 + 5845c4e commit f0fba96

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

includes/Forwarded_URLs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ private function has_forwarded_host() {
135135
public function get_forwarded_host() {
136136

137137
// are we using Forward HQ?
138-
$host = isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : false;
138+
$host = isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
139139

140140
// if not, check if we're using ngrok
141-
$host = ! $host && isset( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) ? $_SERVER['HTTP_X_ORIGINAL_HOST'] : $_SERVER['HTTP_HOST'];
141+
$host = isset( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) ? $_SERVER['HTTP_X_ORIGINAL_HOST'] : $host;
142142

143143
return $host;
144144
}

0 commit comments

Comments
 (0)