]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Request.php
Added testing for our request method overrides
[bookstack] / app / Http / Request.php
index 687bae9a6cb196e221d9c84ca33f3159da01f2ab..13892603db8768df2f1bcfa012d88bc827e75959 100644 (file)
@@ -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();