From 009fc5ea9582ee5ce44d85d805abfd91261ec3c0 Mon Sep 17 00:00:00 2001 From: Sebastian Zoglowek <55794780+zoglo@users.noreply.github.com> Date: Sat, 3 Oct 2026 02:10:15 +0200 Subject: [PATCH 1/2] Add a regression test for local app servers running with double slash requests --- e2e-testing/tests/LocalApplicationServerTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e-testing/tests/LocalApplicationServerTest.php b/e2e-testing/tests/LocalApplicationServerTest.php index 187d829..bbbbd0f 100644 --- a/e2e-testing/tests/LocalApplicationServerTest.php +++ b/e2e-testing/tests/LocalApplicationServerTest.php @@ -65,6 +65,19 @@ public function testPhpServerHandlesFrontControllerRoutesAndStaticFilesAndStops( $this->assertStopped($server->baseUri); } + public function testPhpServerPassesDoubleSlashRequestsToTheFrontController(): void + { + $server = (new WebServerManager())->start(WebServerConfig::php($this->directory)); + + try { + $response = HttpClient::create()->request('GET', $server->baseUri.'//'); + $this->assertSame(200, $response->getStatusCode()); + $this->assertSame('//', $response->toArray()['uri']); + } finally { + $server->stop(); + } + } + public function testServerLoggingCannotBlockRequests(): void { (new Filesystem())->dumpFile($this->directory.'/public/index.php', ' Date: Sat, 3 Oct 2026 02:17:43 +0200 Subject: [PATCH 2/2] Fix the router for requests with double slashes --- e2e-testing/src/Http/PhpRouter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/src/Http/PhpRouter.php b/e2e-testing/src/Http/PhpRouter.php index 7527814..1ec886c 100644 --- a/e2e-testing/src/Http/PhpRouter.php +++ b/e2e-testing/src/Http/PhpRouter.php @@ -25,7 +25,7 @@ public static function generate(string $index, string $prelude = ''): string $prelude - \$path = rawurldecode(parse_url(\$_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/'); + \$path = rawurldecode((string) parse_url(\$_SERVER['REQUEST_URI'], PHP_URL_PATH) ?: '/'); if ('/' !== \$path && is_file(\$_SERVER['DOCUMENT_ROOT'].\$path)) { return false;