diff options
author | Florrie <towerofnix@gmail.com> | 2020-02-04 23:04:57 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2020-02-04 23:04:57 -0400 |
commit | 9ee3dca97a505f7e984517d7d393c993a8961ced (patch) | |
tree | 48d9a72dd9319b428e02ff16794b319c2abec643 | |
parent | 8cbae1fe17bbf51060734861540a398631635ad7 (diff) |
sanitize yo cache
-rw-r--r-- | downloaders.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/downloaders.js b/downloaders.js index e18c8e0..941c805 100644 --- a/downloaders.js +++ b/downloaders.js @@ -32,7 +32,7 @@ const copyFile = (source, target) => { }) } -const disableBackResolving = arg => arg.split('/').map(str => str.replace(/^\../, '_..')).join('/') +// const disableBackResolving = arg => arg.split('/').map(str => str.replace(/^\../, '_..')).join('/') const cachify = (identifier, keyFunction, baseFunction) => { return async arg => { @@ -44,7 +44,7 @@ const cachify = (identifier, keyFunction, baseFunction) => { // Determine where the final file will end up. This is just a directory - // the file's own name is determined by the downloader. const cacheDir = downloaders.rootCacheDir + '/' + identifier - const finalDirectory = cacheDir + '/' + disableBackResolving(keyFunction(arg)) + const finalDirectory = cacheDir + '/' + sanitize(keyFunction(arg)) // Check if that directory only exists. If it does, return the file in it, // because it being there means we've already downloaded it at some point |