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

should decode URI #29

Closed
shimaore opened this issue Nov 26, 2015 · 5 comments
Closed

should decode URI #29

shimaore opened this issue Nov 26, 2015 · 5 comments

Comments

@shimaore
Copy link

The router should call decodeURIComponent on parameters before providing them to the callbacks, so that the callbacks receive the intended values rather than the URI-encoded values.

@shimaore
Copy link
Author

Rational: Typically if I do

<a href="#/do/{value1}">...</a>

then Riot will properly URI-encode the value (spaces, etc.). Conversely, one would expect that when doing

riot.route( '#/do/*', function(value2) { ... } )

the outcome of selecting the link is value1 === value2.

@cognitom
Copy link
Member

@shimaore yeah, should be. Could you send a PR?

@cognitom cognitom mentioned this issue Dec 13, 2015
4 tasks
@cognitom
Copy link
Member

I've been working on this. But I've found that it'll break this spec...
https://github.com/riot/route/blob/master/test/specs/core.specs.js#L95

It looks safer to keep as is, doesn't it?

@cognitom
Copy link
Member

Note: to support this, change this line:

var path = decodeURIComponent(getPathFromBase())

@GianlucaGuarini
Copy link
Member

Closing this issue because it's related to an old router version. Please update to the latest @riotjs/route version if you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants