1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-07 09:10:03 +01:00

some cleaning

This commit is contained in:
Taylor Otwell
2016-05-06 13:03:46 -05:00
parent 623d241386
commit 00c44a74d2
2 changed files with 14 additions and 5 deletions

View File

@@ -47,10 +47,6 @@ public function isStaticFile($sitePath, $siteName, $uri)
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
}
return $sitePath.'/public/index.php';
}
}

View File

@@ -74,10 +74,20 @@ function show_valet_404()
}
/**
* Dispatch the request.
* Overwrite the HTTP host for Ngrok.
*/
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
}
/**
* Allow driver to mutate incoming URL.
*/
$uri = $valetDriver->mutateUri($uri);
/**
* Determine if the incoming request is for a static file.
*/
$uriPathInfo = pathinfo($uri);
$isPhpFile = false;
@@ -90,6 +100,9 @@ function show_valet_404()
return $valetDriver->serveStaticFile($staticFilePath, $valetSitePath, $siteName, $uri);
}
/**
* Attempt to dispatch to a front controller.
*/
$frontControllerPath = $valetDriver->frontControllerPath(
$valetSitePath, $siteName, $uri
);