Skip to content
Browse files

fix Router, do not skip param rules when no the given param is not pr…

…esent
  • Loading branch information...
1 parent f44644e commit c16f1ac70a9b65e891282c8850a041d843350d85 @jankuca committed Apr 9, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/modules/router.js
View
8 src/modules/router.js
@@ -129,12 +129,10 @@ var Router = module.exports.Router = Function.inherit(function () {
} else {
if (Object.getOwnPropertyNames(rules).some(function (key) {
var index = param_keys.indexOf(key);
- if (index > -1) {
- if (!rules[key].test(match[index + 1])) {
- return true;
- }
- params[key] = match[index + 1];
+ if (index === -1 || !rules[key].test(match[index + 1])) {
+ return true;
}
+ params[key] = match[index + 1];
})) {
return;
}

0 comments on commit c16f1ac

Please sign in to comment.
Something went wrong with that request. Please try again.