Skip to content

Commit 5e88e7b

Browse files
committed
Added Unicode Support
I had named of files in Hebrew and I was getting: Error: Could not invalidate cloudfront: InvalidArgument: Your request contains one or more invalid invalidation paths. And with that fix, it works fine :)
1 parent 4bd25e3 commit 5e88e7b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ module.exports = function (options) {
5959
case 'update':
6060
case 'create':
6161
case 'delete':
62-
let path = file.s3.path;
62+
let path = file.s3.path.split('/').map(encodeURIComponent).join('/');
6363

6464
if (options.originPath) {
65+
options.originPath = options.originPath.split('/').map(encodeURIComponent).join('/');
6566
const originRegex = new RegExp(options.originPath.replace(/^\//, '') + '\/?');
6667
path = path.replace(originRegex, '');
6768
}

0 commit comments

Comments
 (0)