Recognize Scaleway S3 replica URLs (#499)
This commit is contained in:
@@ -716,6 +716,9 @@ func ParseHost(s string) (bucket, region, endpoint string, forcePathStyle bool)
|
|||||||
} else if a := digitalOceanRegex.FindStringSubmatch(host); a != nil {
|
} else if a := digitalOceanRegex.FindStringSubmatch(host); a != nil {
|
||||||
bucket, region = a[1], a[2]
|
bucket, region = a[1], a[2]
|
||||||
endpoint = fmt.Sprintf("%s.digitaloceanspaces.com", region)
|
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 {
|
} else if a := linodeRegex.FindStringSubmatch(host); a != nil {
|
||||||
bucket, region = a[1], a[2]
|
bucket, region = a[1], a[2]
|
||||||
endpoint = fmt.Sprintf("%s.linodeobjects.com", region)
|
endpoint = fmt.Sprintf("%s.linodeobjects.com", region)
|
||||||
@@ -742,6 +745,7 @@ var (
|
|||||||
backblazeRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.([^.]+)\.backblazeb2.com$`)
|
backblazeRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.([^.]+)\.backblazeb2.com$`)
|
||||||
filebaseRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.filebase.com$`)
|
filebaseRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.filebase.com$`)
|
||||||
digitalOceanRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.digitaloceanspaces.com$`)
|
digitalOceanRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.digitaloceanspaces.com$`)
|
||||||
|
scalewayRegex = regexp.MustCompile(`^(?:(.+)\.)?s3.([^.]+)\.scw\.cloud$`)
|
||||||
linodeRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.linodeobjects.com$`)
|
linodeRegex = regexp.MustCompile(`^(?:(.+)\.)?([^.]+)\.linodeobjects.com$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user