From 1bfcaa4a17c96e6de7b93fa6ac6ad888330d854e Mon Sep 17 00:00:00 2001 From: Markus Schanz <3457747+schnz@users.noreply.github.com> Date: Mon, 14 Aug 2023 02:07:19 +0200 Subject: [PATCH] Recognize Scaleway S3 replica URLs (#499) --- s3/replica_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/s3/replica_client.go b/s3/replica_client.go index 6919eae..ef8a562 100644 --- a/s3/replica_client.go +++ b/s3/replica_client.go @@ -716,6 +716,9 @@ func ParseHost(s string) (bucket, region, endpoint string, forcePathStyle bool) } else if a := digitalOceanRegex.FindStringSubmatch(host); a != nil { bucket, region = a[1], a[2] endpoint = fmt.Sprintf("%s.digitaloceanspaces.com", region) + } else if a := scalewayRegex.FindStringSubmatch(host); a != nil { + bucket, region = a[1], a[2] + endpoint = fmt.Sprintf("s3.%s.scw.cloud", region) } else if a := linodeRegex.FindStringSubmatch(host); a != nil { bucket, region = a[1], a[2] endpoint = fmt.Sprintf("%s.linodeobjects.com", region) @@ -742,6 +745,7 @@ var ( backblazeRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.([^.]+)\.backblazeb2.com$`) filebaseRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.filebase.com$`) digitalOceanRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.digitaloceanspaces.com$`) + scalewayRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.([^.]+)\.scw\.cloud$`) linodeRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.linodeobjects.com$`) )