Skip to content
Myr

fix behavior when handling request without routes

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

fixes #2159

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 7e01531 · Browse files · 3 files+25 added−3 removed
This commit

State

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

Diff stats

3 files+25 added−3 removed

  • tests:+14 added−2 removed
  • other:+11 added−1 removed

3 files+25 added−3 removed

modified:lib/application.js+10 added-1 removed
117 unmodified lines
118 * @api private119 */120121app.handle = function(req, res, done) {122 var router = this._router;123124 // final handler125 done = done || finalhandler(req, res, {126 env: this.get('env'),127 onerror: logerror.bind(this)128 });129130 // no routes131 if (!router) {132 debug('no routes defined on app');133 done();134 return;135 }136128 this._router.handle(req, res, done);137 router.handle(req, res, done);138};139140/**141 * Proxy `Router#use()` to add middleware to the app router.
396 unmodified lines
modified:test/app.js+14 added-2 removed
modified:History.md+1 added
1unreleased2==========34 * deprecate things with `depd` module5 * fix behavior when handling request without routes6 * use `finalhandler` for final response handling7 * use `media-typer` to alter content-type charset894.4.4 / 2014-06-20
1679 unmodified lines