diff --git a/Project.toml b/Project.toml index 912563d..6a68dfc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CloudStore" uuid = "3365d9ee-d53b-4a56-812d-5344d5b716d7" authors = ["quinnj "] -version = "1.6.2" +version = "1.6.3" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/parse.jl b/src/parse.jl index 840356c..2c73b58 100644 --- a/src/parse.jl +++ b/src/parse.jl @@ -142,8 +142,8 @@ function parseAWSBucketRegionKey(url; parseLocal::Bool=false) ### See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html # https://bucket.vpce-1a2b3c4d-5e6f.s3.region-code.vpce.amazonaws.com/bucket-name/key-name # https://bucket.vpce-1a2b3c4d-5e6f.s3.region-code.vpce.amazonaws.com/bucket-name - m = match(r"^https://bucket\.vpce[^\.]+\.s3\.(?[^\.]+)\.vpce\.amazonaws\.com/(?[^/]+)(?:/(?.+))?$"i, url) - m !== nothing && return _validate_aws(true, false, nothing, m[:bucket], m[:region], m[:key]) + m = match(r"^(?https://bucket\.vpce[^\.]+\.s3\.(?[^\.]+)\.vpce\.amazonaws\.com)/(?[^/]+)(?:/(?.+))?$"i, url) + m !== nothing && return _validate_aws(true, false, m[:host], m[:bucket], m[:region], m[:key]) # https://s3.region-code.amazonaws.com/bucket-name/key-name # https://s3.region-code.amazonaws.com/bucket-name m = match(r"^https://s3(?:\.(?[^\.]+))?\.amazonaws\.com/(?[^/]+)(?:/(?.+))?$"i, url) diff --git a/test/runtests.jl b/test/runtests.jl index fa535c5..358c4d5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -532,8 +532,8 @@ end ("HTtp://127.0.0.1:27181/bucket-name/key-name", (true, false, "HTtp://127.0.0.1:27181", "bucket-name", "", "key-name")), ("htTP://127.0.0.1:27181/bucket-name", (true, false, "htTP://127.0.0.1:27181", "bucket-name", "", "")), - ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name", (true, false, nothing, "bucket-name", "us-west-2", "")), - ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-name", (true, false, nothing, "bucket-name", "us-west-2", "key-name")), + ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name", (true, false, "https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com", "bucket-name", "us-west-2", "")), + ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-name", (true, false, "https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com", "bucket-name", "us-west-2", "key-name")), ] for (url, parts) in s3 ok, accelerate, host, bucket, reg, key = CloudStore.parseAWSBucketRegionKey(url; parseLocal=true)