Multiple trailing or misplaced / can cause page to load as a blank page

https://try.discourse.org/ works https://try.discourse.org// hangs with a blank page display on safari and chrome.

including meta.discourse.org and adding a / after the domain name e.g.

https://meta.discourse.org//top/weekly will hang.

1 Like

Itā€™s the extra forward slash that is causing the pages to not load. Everything works as expected with the single slash. Why do you seem to insist to use an extra slash at the end of the URL?

If I use a double slash at the end of my forumā€™s URL, it does the same - blank pageā€¦ as expected.

1 Like

I am aware of the cause. If the domain name of a forum is put in the address bar of a browser and it autocompletes to a single slash but the user types an extra one on the end, itā€™s going to give a blank page for any discourse forum - this is not desired behaviour, is repeatable and is consistent across URIā€™s.

A further issue would be that the browserā€™s autocomplete may then add a double slash since the blank page format does not throw an error so until the browser deletes itā€™s autocomplete history that would be blank forums for ever more.

1 Like

If you type in https://apnews.com//, you will be taken to the Associated Pressā€™ website and receive a 404 - Page not found. No content gets loaded. The only difference I see is that AP throws a 404, and the Discourse sites only give a blank page (without a 404).

Auto-complete still only shows one forward slash at the end as I type.

So maybe the ā€œbugā€ is not giving a 404 when a double-slash is used?

3 Likes

The ā€˜bugā€™ causes the forum software to still load many megabytes of information according to the safari and chrome consoleā€™s just not display it.

1 Like

When URL redirects and/or routing are expecting a single slash, having a double slash will ā€œbreakā€ what was expected. On a static page, you may (probably will) get everything to load properly. But on a dynamic page, thatā€™s where problems crop up. Even some CGI apps which may directly analyze the URL will fail. Some servers may even see multiple slashes as a form of exploit attack, especially if the double slashes are in the middle of the URL.

Maybe one of the Discourse team can give a better explanation as to how Discourse responds to multiple slashes. But it would be better if a 404 was given in such cases.

2 Likes

This is not a bug, I support improving the 404 page here or doing a redirect or something else.

Maybe there is a trivial change in our ember router, I donā€™t know, will defer to the ember experts.

4 Likes

Pretty sure ember has this fixed for a long time, itā€™s probably our custom location stuff or similar that is causing this.

Will have a look today.

6 Likes

That should fix it:

https://github.com/discourse/discourse/commit/b824af02d452e2d907690d1743b1b40eedb7667c

6 Likes

extra / will show you background of forum , teshghost.tk// (you can see my background wallpaper)

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.