Fix resolve vs realpath

This commit is contained in:
Zef Hemel
2022-05-01 17:20:38 +00:00
parent 098a419ff3
commit 2b4d5a0543
3 changed files with 18 additions and 1 deletions
@@ -23,7 +23,7 @@ export class DiskSpacePrimitives implements SpacePrimitives {
}
safePath(p: string): string {
let realPath = realpathSync(p);
let realPath = path.resolve(p);
if (!realPath.startsWith(this.rootPath)) {
throw Error(`Path ${p} is not in the space`);
}