Skip to content

Commit

Permalink
FIX: Support root paths that omit the trailing slash and have QPs
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed Jul 1, 2020
1 parent 76d5e54 commit 8bc61e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/mapping-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]}`;
Expand Down

2 comments on commit 8bc61e8

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Régis Hanol posted:

That’s probably worth a test?

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robin Ward posted:

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

Please sign in to comment.