From 25654b232214583f06aef0a4edfc28815b66b735 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Wed, 13 Apr 2022 12:46:19 +0100 Subject: [PATCH] Fixed base URL starting slash usage --- app/Http/Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Request.php b/app/Http/Request.php index 687bae9a6..13892603d 100644 --- a/app/Http/Request.php +++ b/app/Http/Request.php @@ -26,6 +26,7 @@ class Request extends LaravelRequest /** * Override the default request methods to get the base URL * to directly use the custom APP_URL, if set. + * The base URL never ends with a / but should start with one if not empty. * * @return string */ @@ -34,7 +35,7 @@ class Request extends LaravelRequest $appUrl = config('app.url', null); if ($appUrl) { - return rtrim(implode('/', array_slice(explode('/', $appUrl), 3)), '/'); + return '/' . rtrim(implode('/', array_slice(explode('/', $appUrl), 3)), '/'); } return parent::getBaseUrl();