Skip to content

Commit 2ddd854

Browse files
jackfromeastpatak-dev
authored andcommitted
fix: backport #18115, DOM Clobbering in
1 parent a6da450 commit 2ddd854

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/vite/src/node/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
10051005
getResolveUrl(
10061006
`'${relativePath}', ${
10071007
umd ? `typeof document === 'undefined' ? location.href : ` : ''
1008-
}document.currentScript && document.currentScript.src || document.baseURI`
1008+
}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
10091009
)
10101010

10111011
const relativeUrlMechanisms: Record<

0 commit comments

Comments
 (0)