1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20:08 +01:00

Improved HTTP_HOST rewriting

This commit is contained in:
Vic D'Elfant
2017-06-06 16:10:41 +02:00
committed by Adam Wathan
parent 4f383f2d77
commit dbcbf1edc7
2 changed files with 12 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ public function isStaticFile($sitePath, $siteName, $uri)
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST']) && isset($_SERVER['HTTP_X_INBOUND_HOST']) && $_SERVER['HTTP_X_ORIGINAL_HOST'] === $_SERVER['HTTP_HOST']) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_INBOUND_HOST'];
}
if (file_exists($frontControllerPath = $sitePath.'/web/app_dev.php')) {
return $frontControllerPath;
} elseif (file_exists($frontControllerPath = $sitePath.'/web/app.php')) {