mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Correct handling of @ in region to be consistent with everythng else.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user