From 7754a3535a3538c87f6462d80cd54c30ad51eba3 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sun, 1 Sep 2013 16:27:03 -0700 Subject: [PATCH] move downstream logic to response middleware --- lib/application.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/application.js b/lib/application.js index e7c5a26..ab5a038 100644 --- a/lib/application.js +++ b/lib/application.js @@ -160,6 +160,9 @@ app.onerror = function(err){ function respond(next){ return function *respond(){ + this.status = 200; + if (this.app.poweredBy) this.set('X-Powered-By', 'koa'); + yield next; var app = this.app; @@ -222,10 +225,7 @@ function respond(next){ * @api private */ -function *downstream() { - this.status = 200; - if (this.app.poweredBy) this.set('X-Powered-By', 'koa'); -} +function *downstream(){} /** * Create a new `Context` constructor.