fix(vue-renderer): prevent can't set headers after they are sent (#5863)

This commit is contained in:
Pooya Parsa 2019-06-04 19:19:18 +04:30 committed by GitHub
parent 0c3b9c5d12
commit 31f5729828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,11 +110,10 @@ export default class ModernRenderer extends SSRRenderer {
}) })
} }
async render(renderContext) { render(renderContext) {
const result = await super.render(renderContext)
if (this.isServerMode) { if (this.isServerMode) {
renderContext.res.setHeader('Vary', 'User-Agent') renderContext.res.setHeader('Vary', 'User-Agent')
} }
return result return super.render(renderContext)
} }
} }