mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(vue-app): don't remove req/res/query unless in full static mode (#8611)
closes #7965
This commit is contained in:
parent
3bba4c6a7f
commit
71a3df8443
@ -80,9 +80,11 @@ export default async (ssrContext) => {
|
||||
<% } %>
|
||||
|
||||
// Remove query from url is static target
|
||||
if (process.static && ssrContext.url) {
|
||||
<% if (isFullStatic) { %>
|
||||
if (ssrContext.url) {
|
||||
ssrContext.url = ssrContext.url.split('?')[0]
|
||||
}
|
||||
<% } %>
|
||||
// Public runtime config
|
||||
ssrContext.nuxt.config = ssrContext.runtimeConfig.public
|
||||
// Create the app definition and the instance (created for each request)
|
||||
|
@ -184,12 +184,14 @@ export async function setContext (app, context) {
|
||||
env: <%= JSON.stringify(env) %><%= isTest ? '// eslint-disable-line' : '' %>
|
||||
}
|
||||
// Only set once
|
||||
if (!process.static && context.req) {
|
||||
<% if (!isFullStatic) { %>
|
||||
if (context.req) {
|
||||
app.context.req = context.req
|
||||
}
|
||||
if (!process.static && context.res) {
|
||||
if (context.res) {
|
||||
app.context.res = context.res
|
||||
}
|
||||
<% } %>
|
||||
if (context.ssrContext) {
|
||||
app.context.ssrContext = context.ssrContext
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user