Skip to content

Commit 95e2b0d

Browse files
antonymCopilot
andauthored
Update lib/utils.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 32caf99 commit 95e2b0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ function validateFilePath(userPath, rootDir) {
4242
try {
4343
const path = require('path');
4444
const resolved = path.resolve(rootDir, userPath);
45+
const rootWithSeparator = path.resolve(rootDir) + path.sep;
4546
return {
4647
path: resolved,
47-
isSecure: resolved.startsWith(rootDir)
48+
isSecure: resolved.startsWith(rootWithSeparator)
4849
};
4950
} catch {
5051
return { path: null, isSecure: false };

0 commit comments

Comments
 (0)