Windows: Return real path, not lowercase path

This commit is contained in:
Scott Nonnenberg 2019-04-10 13:41:22 -07:00
parent f44856c73b
commit f92769db8c

View file

@ -31,9 +31,9 @@ function _createFileHandler({ userDataPath, installPath, isWindows }) {
// finally we do case-insensitive checks on windows
const properCasing = isWindows ? realPath.toLowerCase() : realPath;
if (!path.isAbsolute(properCasing)) {
if (!path.isAbsolute(realPath)) {
console.log(
`Warning: denying request to non-absolute path '${properCasing}'`
`Warning: denying request to non-absolute path '${realPath}'`
);
return callback();
}
@ -47,13 +47,13 @@ function _createFileHandler({ userDataPath, installPath, isWindows }) {
)
) {
console.log(
`Warning: denying request to path '${properCasing}' (userDataPath: '${userDataPath}', installPath: '${installPath}')`
`Warning: denying request to path '${realPath}' (userDataPath: '${userDataPath}', installPath: '${installPath}')`
);
return callback();
}
return callback({
path: properCasing,
path: realPath,
});
};
}