Skip to content

Commit 568a014

Browse files
authoredDec 23, 2022
fix: stop considering parent URLs as public file (#11145)
1 parent b9511f1 commit 568a014

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎packages/vite/src/node/plugins/asset.ts

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ export function checkPublicFile(
210210
return
211211
}
212212
const publicFile = path.join(publicDir, cleanUrl(url))
213+
if (!publicFile.startsWith(publicDir)) {
214+
// can happen if URL starts with '../'
215+
return
216+
}
213217
if (fs.existsSync(publicFile)) {
214218
return publicFile
215219
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.