Skip to content

Commit 42a638e

Browse files
whatsthecraicDrvi
andauthored
Use the http protocol (instead of https) when connecting to Azurite (#44)
* Use the http protocol (instead of https) when connecting to Azurite --------- Co-authored-by: Tomáš Drvoštěp <[email protected]>
1 parent 0d25173 commit 42a638e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/parse.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ end
8484
function _validate_azure(ok::Bool, host, account, container, blob)
8585
return (
8686
ok,
87-
isnothing(host) ? nothing : replace(String(host), r"^azure"i => "https"; count=1),
87+
# We only replace the host when parseLocal is true
88+
isnothing(host) ? nothing : replace(String(host), r"^azure"i => "http"; count=1),
8889
String(validate_account_name(account)),
8990
isnothing(container) ? "" : String(validate_container_name(container)),
9091
isnothing(blob) ? "" : String(validate_blob(blob)),
@@ -95,6 +96,7 @@ function _validate_aws(ok::Bool, accelerate, host, bucket, region, key)
9596
return (
9697
ok,
9798
accelerate,
99+
# We only replace the host when parseLocal is true
98100
isnothing(host) ? nothing : replace(String(host), r"^(s|S)3" => "http"; count=1),
99101
String(validate_bucket_name(bucket, accelerate)),
100102
isnothing(region) || isempty(region) ? "" : String(validate_region(region)),

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ end
245245
("azure://myaccount.blob.core.windows.net/mycontainer", (true, nothing, "myaccount", "mycontainer", "")),
246246
("https://127.0.0.1:45942/myaccount/mycontainer", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "")),
247247
("https://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
248-
("azure://127.0.0.1:45942/myaccount/mycontainer", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "")),
249-
("azure://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
248+
("azure://127.0.0.1:45942/myaccount/mycontainer", (true, "http://127.0.0.1:45942", "myaccount", "mycontainer", "")),
249+
("azure://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "http://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
250250
("azure://myaccount", (true, nothing, "myaccount", "", "")),
251251

252252
("HTTPS://myaccount.BLOB.core.windows.net/mycontainer/myblob", (true, nothing, "myaccount", "mycontainer", "myblob")),
@@ -255,8 +255,8 @@ end
255255
("azurE://myaccount.blob.core.windows.NET/mycontainer", (true, nothing, "myaccount", "mycontainer", "")),
256256
("Https://127.0.0.1:45942/myaccount/mycontainer", (true, "Https://127.0.0.1:45942", "myaccount", "mycontainer", "")),
257257
("hTTPs://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "hTTPs://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
258-
("Azure://127.0.0.1:45942/myaccount/mycontainer", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "")),
259-
("aZURe://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "https://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
258+
("Azure://127.0.0.1:45942/myaccount/mycontainer", (true, "http://127.0.0.1:45942", "myaccount", "mycontainer", "")),
259+
("aZURe://127.0.0.1:45942/myaccount/mycontainer/myblob", (true, "http://127.0.0.1:45942", "myaccount", "mycontainer", "myblob")),
260260
("Azure://myaccount", (true, nothing, "myaccount", "", ""))
261261
]
262262
for (url, parts) in azure

0 commit comments

Comments
 (0)