Skip to content

Commit 5139432

Browse files
committed
Add test for previously failing scenario
1 parent 11a8c93 commit 5139432

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ResponseTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,19 @@ public function test_the_page_url_is_prefixed_with_the_proxy_prefix(): void
385385

386386
$this->assertSame('/sub/directory/user/123', $page['url']);
387387
}
388+
389+
public function test_the_page_url_doesnt_double_up(): void
390+
{
391+
$request = Request::create('/subpath/product/123', 'GET', [], [], [], [
392+
'SCRIPT_FILENAME' => '/project/public/index.php',
393+
'SCRIPT_NAME' => '/subpath/index.php',
394+
]);
395+
$request->headers->add(['X-Inertia' => 'true']);
396+
397+
$response = new Response('Product/Show', []);
398+
$response = $response->toResponse($request);
399+
$page = $response->getData();
400+
401+
$this->assertSame('/subpath/product/123', $page->url);
402+
}
388403
}

0 commit comments

Comments
 (0)