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

Make 127.0.0.1 SERVER_ADDR definition only if null (#1356)

This commit is contained in:
Matt Stauffer
2023-01-29 21:20:18 -05:00
committed by GitHub
parent 609183786b
commit a2d3c04ab5
3 changed files with 4 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ public function isStaticFile($sitePath, $siteName, $uri)
public function frontControllerPath($sitePath, $siteName, $uri)
{
$_SERVER['PHP_SELF'] = $uri;
$_SERVER['SERVER_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_ADDR'] = $_SERVER['SERVER_ADDR'] ?? '127.0.0.1';
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
$dynamicCandidates = [

View File

@@ -49,10 +49,6 @@ public function isStaticFile($sitePath, $siteName, $uri)
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
$_SERVER['PHP_SELF'] = $uri;
$_SERVER['SERVER_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
return parent::frontControllerPath(
$sitePath.'/web',
$siteName,

View File

@@ -27,12 +27,10 @@ public function serves($sitePath, $siteName, $uri)
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
$_SERVER['PHP_SELF'] = $uri;
$_SERVER['SERVER_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
return parent::frontControllerPath(
$sitePath, $siteName, $this->forceTrailingSlash($uri)
$sitePath,
$siteName,
$this->forceTrailingSlash($uri)
);
}