mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Handle application/testing region string inconsistency.
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -45,6 +46,15 @@ func CreateWasabiStorage(
|
|||||||
threads int,
|
threads int,
|
||||||
) (storage *WasabiStorage, err error) {
|
) (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,
|
s3storage, error := CreateS3Storage(regionName, endpoint, bucketName,
|
||||||
storageDir, accessKey, secretKey, threads,
|
storageDir, accessKey, secretKey, threads,
|
||||||
true, // isSSLSupported
|
true, // isSSLSupported
|
||||||
@@ -100,9 +110,6 @@ func (storage *WasabiStorage) MoveFile(
|
|||||||
// The from path includes the bucket
|
// The from path includes the bucket
|
||||||
from_path := fmt.Sprintf("/%s/%s/%s", storage.bucket, storage.storageDir, from)
|
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.
|
// 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)
|
storage.region, storage.endpoint, from_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user