Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e-testing/src/Http/PhpRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions e2e-testing/tests/LocalApplicationServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '<?php error_log(str_repeat("x", 8192)); echo "OK";');
Expand Down
Loading