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

Query params order #17

Open
mstijak opened this issue Jun 18, 2016 · 3 comments
Open

Query params order #17

mstijak opened this issue Jun 18, 2016 · 3 comments

Comments

@mstijak
Copy link
Contributor

mstijak commented Jun 18, 2016

Routes are matched correctly only if query parameters are specified in the right order.

var route = new Route('/?a=:a&b:b');
var result = route.match('/?b=1&a=2');
assert(result);

Would it possible to sort query params when route is parsed and when url is matched to avoid this problem?

@mschipperheyn
Copy link

Yeah, this is not the behaviour I would expect from "named parameters".

@peleteiro
Copy link

👍

@ashconnell
Copy link

ashconnell commented Jun 20, 2017

Yeah this is super odd. I also notice if i do

let route = new Route('/users/:id(?foo=:foo)')
route.match('/users/123?foo=lol&rofl=true')
// output: { id: '123', foo: 'lol&rofl=true' }

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

4 participants