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

Router doesn't check query string values to satisfy conditions #30

Open
kaero opened this issue Sep 28, 2014 · 4 comments
Open

Router doesn't check query string values to satisfy conditions #30

kaero opened this issue Sep 28, 2014 · 4 comments
Labels

Comments

@kaero
Copy link
Contributor

kaero commented Sep 28, 2014

Route definition:

{
    pattern: '/jeans(/<brand>(/<id>))',
    conditions: {
        brand: [ 'levis', 'wrangler' ],
        id: '\\d{3,5}'
    },
    defaults: {
        brand: 'levis'
    }
}

Values for the parameter id is accepted from the URL '/jeans/levis?id=5&id=6':

{
    "brand": "levis",
    "id": [ "5", "6" ]
}
@kaero kaero added the bug label Sep 28, 2014
@kaero kaero self-assigned this Sep 29, 2014
@narqo
Copy link

narqo commented Dec 18, 2015

/jfi @doochik @pasaran

@narqo narqo unassigned kaero Dec 18, 2015
@ruslankerimov
Copy link
Member

Why? It's enough?

@narqo
Copy link

narqo commented Dec 19, 2015

The task was to distinguish this two urls

/jeans/levis
/jeans/levis?id=112

and use different controllers for them. It looks like this is impossible now, as urls:

/jeans/levis
/jeans/levis/12
/jeans/levis/112
/jeans/levis?id=112
/jeans/levis?id=123123123
'/jeans/levis?asdd'

are all matched to the route

{
    pattern: '/jeans(/<brand>(/<id>))',
    conditions: {
        brand: [ 'levis', 'wrangler' ],
        id: '\\d{3,5}'
    },
    data: {
        controller: 'brand'
    }
}

@unyieldingman
Copy link

Hello from 2K20! Got the same problem.

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

No branches or pull requests

4 participants