beedesk / dingo

Django inspired web development framework on NodeJS
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

`urlresolver` should match regardless of "query string" part of the url. #4

Open thomasyip opened 10 years ago

thomasyip commented 10 years ago

For example,

The following url should match:

`http://localhost/12345/?_refer=abc`

with this rule: url('^\(?P<id>\\d{2,20})/$', 'reports.views.index')

However, it doesn't, and I need to change the rule to: url('^\(?P<id>\\d{2,20})/.*$', 'reports.views.index')

The example (dingo-example) should be updated to add a link with query parameter. Please send pull request on both repos.

ulion commented 10 years ago

when you match the url, why not first remove parts after '?' then do the match?

thomasyip commented 10 years ago

@ulion, I think it is what should be done.

Perhaps, parse the url first and only use the path. Be careful not to break the support of optional trailing "/".