diff --git a/src/Http/Environment.php b/src/Http/Environment.php index 8eccc13df7..c3c3648981 100644 --- a/src/Http/Environment.php +++ b/src/Http/Environment.php @@ -753,6 +753,10 @@ public function isLocal(): bool return true; } + if (Str::endsWith($host, '.ddev.site') === true) { + return true; + } + // collect all possible visitor ips $ips = [ $this->get('REMOTE_ADDR'), diff --git a/tests/Http/EnvironmentTest.php b/tests/Http/EnvironmentTest.php index d797022cb7..502da40004 100644 --- a/tests/Http/EnvironmentTest.php +++ b/tests/Http/EnvironmentTest.php @@ -1050,6 +1050,7 @@ public static function isLocalWithServerNameProvider(): array ['localhost', true], ['mydomain.local', true], ['mydomain.test', true], + ['mydomain.ddev.site', true], ['mydomain.com', false], ['mydomain.dev', false], ];