Explorar el Código

HUE-8428 [assist] Fix broken S3 file preview

Johan Ahlen hace 7 años
padre
commit
f3a0adf062
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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 += 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 += '&length=' + (options.length || 118784);