"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
ulozto: Fix downloads returning HTML error page
aliaj1e6d82ac6eef1
diff --git a/backend/ulozto/ulozto.go b/backend/ulozto/ulozto.goindex 7c3ab29ee..8cab77fee 100644--- a/backend/ulozto/ulozto.go+++ b/backend/ulozto/ulozto.go@@ -801,8 +801,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (rc io.Readreq := &api.GetDownloadLinkRequest{Slug: o.slug,UserLogin: o.fs.opt.Username,- // Has to be set but doesn't seem to be used server side.- DeviceID: "foobar",+ DeviceID: fmt.Sprintf("%d", time.Now().UnixNano()),}var resp *api.GetDownloadLinkResponse@@ -815,16 +814,26 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (rc io.Readreturn nil, err}+ downloadURL := resp.Link+ if resp.Hash != "" {+ if strings.Contains(downloadURL, "?") {+ downloadURL += "&"+ } else {+ downloadURL += "?"+ }+ downloadURL += "hash=" + url.QueryEscape(resp.Hash)+ }+opts = rest.Opts{Method: "GET",- RootURL: resp.Link,+ RootURL: downloadURL,Options: options,}var httpResp *http.Responseerr = o.fs.pacer.Call(func() (bool, error) {- httpResp, err = o.fs.cdn.Call(ctx, &opts)+ httpResp, err = o.fs.rest.Call(ctx, &opts)return o.fs.shouldRetry(ctx, httpResp, err, true)})if err != nil {