From 1b722c98183356352a530b1acdc403e9556b3920 Mon Sep 17 00:00:00 2001 From: Kael Zhang Date: Mon, 6 Mar 2017 19:24:55 +0800 Subject: [PATCH] Avoid setting http status code explicitly, related to webpack/webpack-dev-middleware#174 --- middleware.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/middleware.js b/middleware.js index a2151e6b1..dedcb1996 100644 --- a/middleware.js +++ b/middleware.js @@ -69,8 +69,7 @@ module.exports = function(compiler, options) { res.setHeader(name, context.options.headers[name]); } } - // Express automatically sets the statusCode to 200, but not all servers do (Koa). - res.statusCode = res.statusCode || 200; + if(res.send) res.send(content); else res.end(content); }