Skip to content

Commit

Permalink
Avoid setting http status code explicitly, related to webpack#174
Browse files Browse the repository at this point in the history
  • Loading branch information
Kael Zhang committed Mar 6, 2017
1 parent 8e870fd commit 1b722c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1b722c9

Please sign in to comment.