stick icon indicating copy to clipboard operation
stick copied to clipboard

Mounts not sorted prior to searching

Open oravecz opened this issue 14 years ago • 2 comments

If I have the following two mounts defined: app.mount('/', module.resolve('test1/config')); app.mount('/test2', module.resolve('test2/config'));

The first one will always match the incoming url. It is probably best to sort the mounts by least specific prior to matching. Least specific in this case would be determined by the number of slashes in the spec.path. In the above example, the trailing slash is removed from all paths, so the first mount actually becomes "" and the second is "/test2".

oravecz avatar Feb 05 '11 02:02 oravecz

Fixed by pull request

oravecz avatar Jun 21 '11 00:06 oravecz

the pull branch is gone. did this really work? :) only for mount and not route? was it a good idea?

oberhamsi avatar May 08 '13 17:05 oberhamsi