From 9ee3dca97a505f7e984517d7d393c993a8961ced Mon Sep 17 00:00:00 2001 From: Florrie Date: Tue, 4 Feb 2020 23:04:57 -0400 Subject: sanitize yo cache --- downloaders.js | 4 ++-- 1 file 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 -- cgit 1.3.0-6-gf8a5