From e86c6d5b5dc45481392d1fe5ccea0e4797929fbd Mon Sep 17 00:00:00 2001 From: liber Date: Sun, 20 Aug 2017 15:07:07 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed:AssertionError [ERR_ASSERTION]: headers have already been sent --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 82e8341..4a0bd12 100644 --- a/index.js +++ b/index.js @@ -47,7 +47,7 @@ function invokeController(options, app) { } if (instance[method]) { // pre set request status - if (ctx.body === undefined && options.preSetStatus) { + if (ctx.body === undefined && options.preSetStatus && !ctx.status) { ctx.status = options.preSetStatus; } return instance[method]();