Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…esent
  • Loading branch information...
commit c16f1ac70a9b65e891282c8850a041d843350d85 1 parent f44644e
@jankuca authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.