From 259f8f8d1bfab081ec454522b79a1ee47daaaaaa Mon Sep 17 00:00:00 2001 From: Salakar Date: Sat, 7 Jul 2018 02:30:23 +0100 Subject: [PATCH] [storage][js] automatically attempt to call `decodeURI` on `putFile` paths --- lib/modules/storage/reference.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/modules/storage/reference.js b/lib/modules/storage/reference.js index b58a3007..c1d75fba 100644 --- a/lib/modules/storage/reference.js +++ b/lib/modules/storage/reference.js @@ -96,7 +96,8 @@ export default class StorageReference extends ReferenceBase { * @return {Promise} */ putFile(filePath: Object, metadata: Object = {}): Promise { - const _filePath = filePath.replace('file://', ''); + let _filePath = filePath.replace('file://', ''); + if (_filePath.includes('%')) _filePath = decodeURI(_filePath); return new StorageTask( UPLOAD_TASK, getNativeModule(this._storage).putFile(this.path, _filePath, metadata),