Skip to content
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

Slash in route params values Cannot match any routes on refresh with HashLocationStrategy #9483

Closed
robwormald opened this issue Jun 22, 2016 · 8 comments

Comments

@robwormald
Copy link
Contributor

From @Delagen on June 16, 2016 8:9

simple url http://site.com/#/route;back=/a/b/c

Error: Cannot match any routes: 'route;back=true/a/b/c'

Copied from original issue: angular/vladivostok#59

@robwormald
Copy link
Contributor Author

From @Delagen on June 16, 2016 8:10

Referece #8603 #8461

@robwormald
Copy link
Contributor Author

From @zoechi on June 16, 2016 8:17

What's the purpose of this issue if there are 2 similar already? What router version are you using?
If your previous comment was meant to point out duplicates you could close the issue yourself.

@robwormald
Copy link
Contributor Author

From @Delagen on June 16, 2016 8:25

3.0.0-alpha.6
Third iteration of router but still not usable in some cases, and solution not provided

@robwormald
Copy link
Contributor Author

From @zoechi on June 16, 2016 8:53

Sorry, I missed that this is not the https://github.com/angular/angular repo

@vsavkin
Copy link
Contributor

vsavkin commented Jul 8, 2016

I tried to reproduce the issue using the latest release of the router, and it looks like the issue has been fixed. If you can still repro the issue, please provide a plunker.

@vsavkin vsavkin closed this as completed Jul 8, 2016
@Delagen
Copy link
Contributor

Delagen commented Jul 11, 2016

@vsavkin @robwormald Does not fixed

http://plnkr.co/edit/dR0oN3vXaIi0zKQkyibd

Click [crisis center] link and reload FRAME via browser context menu

platform-browser.umd.js:2311 Error: Uncaught (in promise): Error: Cannot match any routes: 'crisis-center;a=true/a/a/a/a'

@vsavkin
Copy link
Contributor

vsavkin commented Jul 15, 2016

@Delagen

If you are pasting the following into the browser location bar crisis-center;a=true/a/a, then the router will create the following segments:

  • crisis-center;a=true
  • a
  • a

And, as a result, it won't be able to match any routes.

However, if you navigate to that url using the router API: router.navigate('crisis-center', {a: 'true/a/a/a/'});, then the router will escape the slashes.

This is a correct behavior. The router escapes the segments and the parameters when updating the URL bar, and unescapes them when parsing the URL. If you are constructing the URL yourself, it is your responsibility to escape it.

The escaping works properly in the latest build of the router (e.g., see this plunkr to see how it is set up http://plnkr.co/edit/0scjLRAd2voWTJ4giBhO?p=preview). It does not work properly in beta2.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants