Skip to content

Commit 62f45c3

Browse files
authored
fix(router): check internal dead links without the domain (#1210)
1 parent 972870f commit 62f45c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/router/src/Static/StaticGenerateCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
use function Tempest\Support\Language\pluralize;
3535
use function Tempest\Support\path;
36+
use function Tempest\Support\str;
3637
use function Tempest\uri;
3738

3839
final class StaticGenerateCommand
@@ -226,7 +227,7 @@ private function detectDeadLinks(string $uri, string $html, bool $checkExternal
226227
if (Str\starts_with($link, '/') || Str\starts_with($this->getLinkWithoutProtocol($link), $this->getLinkWithoutProtocol($this->appConfig->baseUri))) {
227228
do {
228229
$target ??= match (true) {
229-
Str\starts_with($link, '/') => $this->appConfig->baseUri . '/' . Str\strip_start($link, '/'),
230+
! Str\starts_with($link, '/') => str($link)->stripStart($this->appConfig->baseUri)->finish('/')->toString(),
230231
default => $link,
231232
};
232233

0 commit comments

Comments
 (0)