Skip to content

Commit

Permalink
security(app-vite): do not leak currentScript when on SSR with Pinia/…
Browse files Browse the repository at this point in the history
…Vuex
  • Loading branch information
rstoenescu committed Jan 13, 2023
1 parent e2cbde7 commit 011320c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app-vite/lib/modes/ssr/ssr-devserver.js
Expand Up @@ -29,7 +29,7 @@ function resolvePublicFolder () {
}

const doubleSlashRE = /\/\//g
const autoRemove = 'var currentScript=document.currentScript;currentScript.parentNode.removeChild(currentScript)'
const autoRemove = 'document.currentScript.remove()'

const ouchInstance = (new Ouch()).pushHandler(
new Ouch.handlers.PrettyPageHandler('orange', null, 'sublime')
Expand Down
2 changes: 1 addition & 1 deletion app-vite/templates/entry/ssr-prod-webserver.js
Expand Up @@ -65,7 +65,7 @@ function renderModulesPreload (modules) {
}

<% if (store && ssr.manualStoreSerialization !== true) { %>
const autoRemove = 'var currentScript=document.currentScript;currentScript.parentNode.removeChild(currentScript)'
const autoRemove = 'document.currentScript.remove()'

function renderStoreState (ssrContext) {
const nonce = ssrContext.nonce !== void 0
Expand Down

0 comments on commit 011320c

Please sign in to comment.