From 8dfae9fa54e12d948877398c42168d9501f56689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 21 Feb 2017 18:22:27 +0000 Subject: [PATCH] Fix headers sent --- lib/render.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/render.js b/lib/render.js index 105b3dc35..59f9199dc 100644 --- a/lib/render.js +++ b/lib/render.js @@ -54,11 +54,12 @@ export function render (req, res) { /* istanbul ignore if */ if (this.dev && req.url.indexOf(self.options.build.publicPath) === 0 && req.url.includes('.hot-update.json')) { res.statusCode = 404 - return res.end() + return { html: '' } } return this.renderRoute(req.url, context) }) - .then(({ html, error }) => { + .then(({ html, error, redirected }) => { + if (redirected) return html if (error) { res.statusCode = context.nuxt.error.statusCode || 500 }