From c4073cde471331cebc6f45c52fe9244ed93fd661 Mon Sep 17 00:00:00 2001 From: Ebrahim Gomaa Date: Mon, 25 Dec 2023 22:03:43 +0200 Subject: [PATCH] hotfix / remove hard coded prefix handling of encrypted upload (#1344) * remove hard coded prefix handling of encrypted upload * fix for other parts of the file --- wasmsdk/blobber.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/wasmsdk/blobber.go b/wasmsdk/blobber.go index cd9d59338..53fcab0b3 100644 --- a/wasmsdk/blobber.go +++ b/wasmsdk/blobber.go @@ -589,9 +589,7 @@ func multiUpload(jsonBulkUploadOptions string) (MultiUploadResult, error) { wg.Add(1) encrypt := option.Encrypt remotePath := option.RemotePath - if strings.HasPrefix(remotePath, "/Encrypted") { - encrypt = true - } + fileReader := jsbridge.NewFileReader(option.ReadChunkFuncName, option.FileSize) mimeType, err := zboxutil.GetFileContentType(fileReader) if err != nil { @@ -678,9 +676,7 @@ func uploadWithJsFuncs(allocationID, remotePath string, readChunkFuncName string } } wg.Add(1) - if strings.HasPrefix(remotePath, "/Encrypted") { - encrypt = true - } + fileReader := jsbridge.NewFileReader(readChunkFuncName, fileSize) @@ -760,9 +756,6 @@ func upload(allocationID, remotePath string, fileBytes, thumbnailBytes []byte, w wg := &sync.WaitGroup{} statusBar := &StatusBar{wg: wg} wg.Add(1) - if strings.HasPrefix(remotePath, "/Encrypted") { - encrypt = true - } fileReader := bytes.NewReader(fileBytes)