nodules/susanin

Matched from path parameters overrides values passed via query string

Closed this issue · 1 comments

Route definition:

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

Result for URL '/jeans/levis?id=567&id=678':

{
    "brand": "levis",
    "id": [ "567", "678" ]
}

but result for URL '/jeans/levis/456?id=567&id=678' looks incorrect (query string values overridden by matched from path, instead of be extended):

{
    "brand": "levis",
    "id": "456"
}

We told with @kaero about logic of merging params and it had already been fixed in 1.0.0 version: demo1, demo2.