diff --git a/src/duplicacy_storage.go b/src/duplicacy_storage.go index df13c90..db61c7b 100644 --- a/src/duplicacy_storage.go +++ b/src/duplicacy_storage.go @@ -468,6 +468,10 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor endpoint := matched[3] bucket := matched[5] + if region != "" { + region = region[:len(region)-1] + } + key := GetPassword(preference, "wasabi_key", "Enter Wasabi key:", true, resetPassword) secret := GetPassword(preference, "wasabi_secret", diff --git a/src/duplicacy_wasabistorage.go b/src/duplicacy_wasabistorage.go index e0d432f..b4011c4 100644 --- a/src/duplicacy_wasabistorage.go +++ b/src/duplicacy_wasabistorage.go @@ -19,7 +19,6 @@ import ( "errors" "fmt" "net/http" - "strings" "time" ) @@ -46,15 +45,6 @@ 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 @@ -110,8 +100,7 @@ func (storage *WasabiStorage) MoveFile( // The from path includes the bucket from_path := fmt.Sprintf("/%s/%s/%s", storage.bucket, storage.storageDir, from) - // We get the region with an @ on the end, so don't add another. - object := fmt.Sprintf("https://%s%s%s", + object := fmt.Sprintf("https://%s@%s%s", storage.region, storage.endpoint, from_path) // The object's new name is relative to the top of the bucket.