move downstream logic to response middleware
This commit is contained in:
parent
37a7457d28
commit
7754a3535a
1 changed files with 4 additions and 4 deletions
|
@ -160,6 +160,9 @@ app.onerror = function(err){
|
||||||
|
|
||||||
function respond(next){
|
function respond(next){
|
||||||
return function *respond(){
|
return function *respond(){
|
||||||
|
this.status = 200;
|
||||||
|
if (this.app.poweredBy) this.set('X-Powered-By', 'koa');
|
||||||
|
|
||||||
yield next;
|
yield next;
|
||||||
|
|
||||||
var app = this.app;
|
var app = this.app;
|
||||||
|
@ -222,10 +225,7 @@ function respond(next){
|
||||||
* @api private
|
* @api private
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function *downstream() {
|
function *downstream(){}
|
||||||
this.status = 200;
|
|
||||||
if (this.app.poweredBy) this.set('X-Powered-By', 'koa');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new `Context` constructor.
|
* Create a new `Context` constructor.
|
||||||
|
|
Loading…
Reference in a new issue