FIX: Support root paths that omit the trailing slash and have QPs

FIX: Support root paths that omit the trailing slash and have QPs

diff --git a/app/assets/javascripts/discourse/app/mapping-router.js b/app/assets/javascripts/discourse/app/mapping-router.js
index ca6728a..0e69bb1 100644
--- a/app/assets/javascripts/discourse/app/mapping-router.js
+++ b/app/assets/javascripts/discourse/app/mapping-router.js
@@ -12,7 +12,7 @@ const BareRouter = EmberRouter.extend({
     url = rewritePath(url);
     const params = url.split("?");
 
-    if (params[0] === "/") {
+    if (params[0] === "/" || params[0] === "") {
       url = defaultHomepage();
       if (params[1] && params[1].length) {
         url = `${url}?${params[1]}`;

GitHub sha: 8bc61e84

1 Like

That’s probably worth a test?

The problem is if you test without a subfolder the root path automatically adds a / so it’s quite hard to test.

1 Like