mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 19:02:45 +00:00
averify that the path is not a folder
This commit is contained in:
@@ -337,6 +337,9 @@ module.exports.isFilePathValid = async (options) => {
|
||||
);
|
||||
|
||||
if (ofs.existsSync(anonymizedFilePath)) {
|
||||
if (fs.lstatSync(anonymizedFilePath).isDirectory()) {
|
||||
throw "is_folder";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -367,6 +370,9 @@ module.exports.isFilePathValid = async (options) => {
|
||||
);
|
||||
|
||||
if (ofs.existsSync(originalFilePath)) {
|
||||
if (fs.lstatSync(originalFilePath).isDirectory()) {
|
||||
throw "is_folder";
|
||||
}
|
||||
if (!module.exports.isFileSupported(repoConfig, originalFilePath)) {
|
||||
throw "file_not_supported";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user