Fix headers sent

This commit is contained in:
Sébastien Chopin 2017-02-21 18:22:27 +00:00
parent 6cc1231eb2
commit 8dfae9fa54

View File

@ -54,11 +54,12 @@ export function render (req, res) {
/* istanbul ignore if */ /* istanbul ignore if */
if (this.dev && req.url.indexOf(self.options.build.publicPath) === 0 && req.url.includes('.hot-update.json')) { if (this.dev && req.url.indexOf(self.options.build.publicPath) === 0 && req.url.includes('.hot-update.json')) {
res.statusCode = 404 res.statusCode = 404
return res.end() return { html: '' }
} }
return this.renderRoute(req.url, context) return this.renderRoute(req.url, context)
}) })
.then(({ html, error }) => { .then(({ html, error, redirected }) => {
if (redirected) return html
if (error) { if (error) {
res.statusCode = context.nuxt.error.statusCode || 500 res.statusCode = context.nuxt.error.statusCode || 500
} }