Browse Source

HUE-8428 [assist] Fix broken S3 file preview

Johan Ahlen 7 years ago
parent
commit
0c107da8cb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      desktop/core/src/desktop/static/desktop/js/apiHelper.js

+ 5 - 1
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -539,7 +539,11 @@ var ApiHelper = (function () {
       url = HDFS_API_PREFIX;
       url = HDFS_API_PREFIX;
     }
     }
 
 
-    url += options.path.join('/') + '?compression=none&mode=text';
+    var clonedPath = options.path.concat();
+    if (clonedPath.length && clonedPath[0] === '/') {
+      clonedPath.shift();
+    }
+    url += clonedPath.join('/') + '?compression=none&mode=text';
     url += '&offset=' + (options.offset || 0);
     url += '&offset=' + (options.offset || 0);
     url += '&length=' + (options.length || 118784);
     url += '&length=' + (options.length || 118784);