diff --git a/src/duplicacy_wasabistorage.go b/src/duplicacy_wasabistorage.go index 3045ef2..e0d432f 100644 --- a/src/duplicacy_wasabistorage.go +++ b/src/duplicacy_wasabistorage.go @@ -19,6 +19,7 @@ import ( "errors" "fmt" "net/http" + "strings" "time" ) @@ -45,6 +46,15 @@ func CreateWasabiStorage( threads int, ) (storage *WasabiStorage, err error) { + // The application code that parses the URL from the + // configuration leaves an @ on the end, while the code that + // does the testing doesn't. Force the incoming value to + // behave like the application. + + if regionName != "" && !strings.HasSuffix(regionName, "@") { + regionName = regionName + "@" + } + s3storage, error := CreateS3Storage(regionName, endpoint, bucketName, storageDir, accessKey, secretKey, threads, true, // isSSLSupported @@ -100,9 +110,6 @@ func (storage *WasabiStorage) MoveFile( // The from path includes the bucket from_path := fmt.Sprintf("/%s/%s/%s", storage.bucket, storage.storageDir, from) - // The to path does not. - // to_path := fmt.Sprintf("%s/%s", storage.storageDir, from) - // We get the region with an @ on the end, so don't add another. object := fmt.Sprintf("https://%s%s%s", storage.region, storage.endpoint, from_path)