mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 03:34:39 -06:00
Handle application/testing region string inconsistency.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user