Skip to content
Myr

Fixed gotcha invoking app.param() callbacks once per route middleware. Closes #638

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent f5c4e9d · Browse files · 2 files+3 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−20 removed

  • other:+3 added−20 removed

2 files+3 added−20 removed

modified:lib/http.js+3 added-20 removed
448 unmodified lines
449450// Generate routing methods451452function generateMethod(method){453 Server.prototype[method] = function(path, fn){453 Server.prototype[method] = function(path){454 var self = this;455456 // Lookup457 if (1 == arguments.length) {
2 unmodified lines
460 : method);461 }462463 // Ensure router is mounted464 if (!this.__usedRouter) {465 this.use(this.router);466 }464 if (!this.__usedRouter) this.use(this.router);465468 // Route specific middleware support469 if (arguments.length > 2) {470 var args = Array.prototype.slice.call(arguments, 1);471 fn = args.pop();472 (function stack(middleware){473 middleware.forEach(function(fn){474 if (Array.isArray(fn)) {475 stack(fn);476 } else {477 self[method](path, fn);478 }479 });480 })(args);481 }482466 // Generate the route484 this.routes[method](path, fn);467 this.routes[method].apply(this, arguments);468 return this;469 };470 return arguments.callee;471}
6 unmodified lines
modified:support/connectnot shown

Its text is not shown, modified.