diff --git a/src/duplicacy_wasabistorage.go b/src/duplicacy_wasabistorage.go index b4011c4..9cf59a2 100644 --- a/src/duplicacy_wasabistorage.go +++ b/src/duplicacy_wasabistorage.go @@ -97,8 +97,14 @@ func (storage *WasabiStorage) MoveFile( threadIndex int, from string, to string, ) (err error) { - // The from path includes the bucket - from_path := fmt.Sprintf("/%s/%s/%s", storage.bucket, storage.storageDir, from) + var from_path string + // The from path includes the bucket. Take care not to include an empty storageDir + // string as Wasabi's backend will return 404 on URLs with double slashes. + if (storage.storageDir == "") { + from_path = fmt.Sprintf("/%s/%s", storage.bucket, from) + } else { + from_path = fmt.Sprintf("/%s/%s/%s", storage.bucket, storage.storageDir, from) + } object := fmt.Sprintf("https://%s@%s%s", storage.region, storage.endpoint, from_path)