1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

Merge pull request #459 from jtackaberry/master

Fix "Failed to fossilize chunk" errors in wasabi backend
This commit is contained in:
gilbertchen
2018-07-24 21:52:27 -04:00
committed by GitHub

View File

@@ -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)