-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double slashes in URLs cause issues #10937
Comments
i'm running into this issue as well, ended up patching it server side but would be nice if ember didnt explode :) |
@railsjedi added the pull request as it passes the tests and works to fix the error however like I said Ember folk might want to fix it differently. |
Could we fix this by always pushing an absolute URL instead of a relative one? E.g. |
@tomdale yup I think so, just considering the use of a shimmed version of Then as @stefanpenner mentioned I will think of a suitable test too. |
Closing in favor of #11801. |
When I visit a URL with double slashes there are two separate but different issues however I am putting them both here mostly as a question.
Double slash at URL base
When I go to:
http://www.emberaddons.com//?query=asdasd
I get the following error(Along with no application and a blank page):
This is caused by:
This is reproducible on both Firefox and Chrome (No others tested).
Double slash in the middle of a URL
I'm not certain if this has been introduced recently however a valid URL of:
/info/privacy
when browsed as:/info//privacy
does not match the router route.Caused by
I have not had time to git bisect which commit caused this issue however it has only happened recently, I suspect knowing how nasty
history.pushState
can be this is the cause: e23ce41Prodding @tomdale as this is your commit.
Question
So this could be solved by always removing double slashes before it is routed, which would solve both issues.
However this could quite easily not be desired as dynamic variables Ember might want to be blank, so a route of:
/info/:page/:thing/page
might want to match if URL is:/info///page
. (I personally don't like this and could be solved by some form of keyword too, Catalyst permits this however most frameworks don't).Thanks
The text was updated successfully, but these errors were encountered: