Skip to content

Commit 75743d6

Browse files
committed
fix: patch up redirect base url
1 parent 192092d commit 75743d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Response.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ public function redirect(string $url, int $status = 302)
229229
return;
230230
}
231231

232+
if (class_exists('Leaf\App')) {
233+
$url = str_replace('//', '/', app()->getBasePath() . $url);
234+
}
235+
232236
Headers::status($status);
233237
Headers::set('Location', $url, true, $status);
234238
}

0 commit comments

Comments
 (0)