소스 검색

HUE-8428 [assist] Fix broken S3 file preview

Johan Ahlen 7 년 전
부모
커밋
f3a0adf062
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);