17337: Fixed encode uri
[arvados-workbench2.git] / src / services / collection-service / collection-service-files-response.ts
index 5e6f7b83f0ecf7628546ce5101dd75c7e52f6629..c1176cd5645967c99a4af78f770268c2c2d14048 100644 (file)
@@ -28,7 +28,7 @@ export const extractFilesData = (document: Document) => {
             const name = getTagValue(element, 'D:displayname', '');
             const size = parseInt(getTagValue(element, 'D:getcontentlength', '0'), 10);
             const url = getTagValue(element, 'D:href', '');
-            const nameSuffix = `/${name || ''}`;
+            const nameSuffix = `/${encodeURIComponent(name) || ''}`;
             const collectionUuidMatch = collectionUrlPrefix.exec(url);
             const collectionUuid = collectionUuidMatch ? collectionUuidMatch.pop() : '';
             const directory = url
@@ -53,5 +53,6 @@ export const extractFilesData = (document: Document) => {
         });
 };
 
-export const getFileFullPath = ({ name, path }: CollectionFile | CollectionDirectory) =>
-    `${path}/${name}`;
+export const getFileFullPath = ({ name, path }: CollectionFile | CollectionDirectory) => {
+    return `${path}/${name}`;
+};
\ No newline at end of file