From 8393bb431b3a5b57915073c03f6bc8789442518e Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sat, 23 Dec 2023 16:31:41 +0100 Subject: [PATCH] Treat DDEV domains as local Fixes #6088 --- src/Http/Environment.php | 4 ++++ tests/Http/EnvironmentTest.php | 1 + 2 files changed, 5 insertions(+) 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 dc9dabd9a8..d81f3f9d57 100644 --- a/tests/Http/EnvironmentTest.php +++ b/tests/Http/EnvironmentTest.php @@ -1050,6 +1050,7 @@ public function providerForServerNames() ['localhost', true], ['mydomain.local', true], ['mydomain.test', true], + ['mydomain.ddev.site', true], ['mydomain.com', false], ['mydomain.dev', false], ];