From 2efabde21587379677201f64085560330e536c21 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Tue, 17 Jan 2017 19:45:29 -0800 Subject: [PATCH] Fix koa-404 issue by adding res.statusCode to 200 (#815) --- examples/custom-server-koa/server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/custom-server-koa/server.js b/examples/custom-server-koa/server.js index 0b24e1ed577f4..8091ec371c74d 100644 --- a/examples/custom-server-koa/server.js +++ b/examples/custom-server-koa/server.js @@ -26,6 +26,13 @@ app.prepare() this.respond = false }) + server.use(function *(next) { + // Koa doesn't seems to set the default statusCode. + // So, this middleware does that + this.res.statusCode = 200 + yield next + }) + server.use(router.routes()) server.listen(3000, (err) => { if (err) throw err