mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
Fix headers sent
This commit is contained in:
parent
6cc1231eb2
commit
8dfae9fa54
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user