Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: fix rclone link when object path contains special characters

Alishan Ladhani7821cb884d04
diff --git a/backend/b2/b2.go b/backend/b2/b2.go
index 56d8ff117..726c8ffa3 100644
--- a/backend/b2/b2.go
+++ b/backend/b2/b2.go
@@ -1426,7 +1426,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
if err != nil {
return "", err
}
- absPath := "/" + bucketPath
+ absPath := "/" + urlEncode(bucketPath)
link = RootURL + "/file/" + urlEncode(bucket) + absPath
bucketType, err := f.getbucketType(ctx, bucket)
if err != nil {