fix: s3put not replacing enough \\ (#25866)

This commit is contained in:
Jeremy Rose 2020-10-12 19:02:25 -07:00 committed by GitHub
parent 501900cdc6
commit 8243255316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,7 @@ if (prefix && !prefix.endsWith(path.sep)) prefix = path.resolve(prefix) + path.s
function filenameToKey (file) {
file = path.resolve(file);
if (file.startsWith(prefix)) file = file.substr(prefix.length - 1);
return key_prefix + file.replace(path.sep, '/');
return key_prefix + (path.sep === '\\' ? file.replace(/\\/g, '/') : file);
}
let anErrorOccurred = false;