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

Encoding slashes and reverse parsing #15

Closed
denis-sokolov opened this issue Jun 1, 2015 · 1 comment
Closed

Encoding slashes and reverse parsing #15

denis-sokolov opened this issue Jun 1, 2015 · 1 comment

Comments

@denis-sokolov
Copy link
Contributor

For any route r and a set of parameters obj, I would expect r(r(obj)) to result in obj.
That is, building a url and then parsing it back should give the original set of parameters.
Unfortunately, that is not the case if any parameters contain slashes:

docuri.route('/:key', 'r')
var path = docuri['r']({key:'foo/bar'});
// path is '/foo/bar'
docuri['r'](path)

Observed result: false.
Expected result: {key:'foo/bar'}.

This is because forward slashes are not encoded in any way when building the URL and the information is lost. Fixing this is likely not backwards-compatible, but also important, isn't it?

@jo
Copy link
Owner

jo commented Jun 1, 2015

+1

@jo jo closed this as completed in 5cc5e5a Jun 5, 2015
jo added a commit that referenced this issue Jun 5, 2015
Encode parameter values to allow slashes in values, fix #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants