Skip to content

State transitions escape slashes for path-like parameters #519

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

Closed
ghost opened this issue Oct 23, 2013 · 6 comments
Closed

State transitions escape slashes for path-like parameters #519

ghost opened this issue Oct 23, 2013 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 23, 2013

For cases such as $stateProvider.state('resource', {url: '/resource/{path:.*}'}), $state.go('resource', {path: 'a/b'}) attempts to go to /resource/a%2Fb.

http://plnkr.co/edit/OoMqgB

@nateabele
Copy link
Contributor

Yup, that's how that works.

@timkindberg
Copy link
Contributor

@timkindberg timkindberg reopened this Oct 23, 2013
@ghost
Copy link
Author

ghost commented Oct 23, 2013

Definitely a bug, at least for *path shorthand. Not sure what's expected behavior for custom regex params.

Perhaps a convention can be introduced for "raw" params? Something along the lines of

{
  url: '/document/{&relativePath:.*}'
}

This patch seems to work for the above suggestion: https://gist.github.com/ntijanic/7116905/revisions

@nateabele
Copy link
Contributor

@timkindberg There are no tests to suggest that catch-all parameters are supposed to work in reverse (and the lack of explicitness that would entail would be a security vulnerability anyway).

@ntijanic Work has already been started to allow typed parameters, which means escaping/unescaping would be user-controllable, which would allow for the above, and be a better system than additional code & complexity added to enable one special case.

@timkindberg
Copy link
Contributor

Ok I see. Makes sense.

@nateabele
Copy link
Contributor

Closing in favor of #454.

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