@@ -139,7 +139,10 @@ function isretryable(e::HTTP.StatusError)
139139 false
140140end
141141isretryable (e:: Base.IOError ) = true
142- isretryable (e:: HTTP.IOExtras.IOError ) = isretryable (e. e)
142+ isretryable (e:: HTTP.Exceptions.ConnectError ) = true
143+ isretryable (e:: HTTP.Exceptions.HTTPError ) = true
144+ isretryable (e:: HTTP.Exceptions.RequestError ) = true
145+ isretryable (e:: HTTP.Exceptions.TimeoutError ) = true
143146isretryable (e:: Base.EOFError ) = true
144147isretryable (e:: Sockets.DNSError ) = Base. uverrorname (e. code) == " EAI_NONAME" ? false : true
145148isretryable (e) = false
@@ -178,9 +181,10 @@ function Base.mkpath(c::AzContainer)
178181 @retry c. nretry HTTP. request (
179182 " PUT" ,
180183 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) ?restype=container" ,
181- Dict (
184+ [
182185 " Authorization" => " Bearer $(token (c. session)) " ,
183- " x-ms-version" => API_VERSION),
186+ " x-ms-version" => API_VERSION
187+ ],
184188 retry = false )
185189 end
186190 nothing
@@ -210,12 +214,13 @@ function writebytes(c::AzContainer, o::AbstractString, data::DenseArray{UInt8};
210214 @retry c. nretry HTTP. request (
211215 " PUT" ,
212216 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) /$(addprefix (c,o)) " ,
213- Dict (
217+ [
214218 " Authorization" => " Bearer $(token (c. session)) " ,
215219 " x-ms-version" => API_VERSION,
216220 " Content-Length" => " $(length (data)) " ,
217221 " Content-Type" => contenttype,
218- " x-ms-blob-type" => " BlockBlob" ),
222+ " x-ms-blob-type" => " BlockBlob"
223+ ],
219224 data,
220225 retry = false ,
221226 verbose = c. verbose)
@@ -233,11 +238,12 @@ function writebytes(c::AzContainer, o::AbstractString, data::DenseArray{UInt8};
233238 @retry c. nretry HTTP. request (
234239 " PUT" ,
235240 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) /$(addprefix (c,o)) ?comp=blocklist" ,
236- Dict (
241+ [
237242 " x-ms-version" => API_VERSION,
238243 " Authorization" => " Bearer $(token (c. session)) " ,
239244 " Content-Type" => " application/octet-stream" ,
240- " Content-Length" => " $(length (blocklist)) " ),
245+ " Content-Length" => " $(length (blocklist)) "
246+ ],
241247 blocklist,
242248 retry = false )
243249 nothing
@@ -421,12 +427,13 @@ function readbytes!(c::AzContainer, o::AbstractString, data::DenseArray{UInt8};
421427 @retry c. nretry HTTP. open (
422428 " GET" ,
423429 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) /$(addprefix (c,o)) " ,
424- Dict (
430+ [
425431 " Authorization" => " Bearer $(token (c. session)) " ,
426432 " x-ms-version" => API_VERSION,
427- " Range" => " bytes=$offset -$(offset+ length (data)- 1 ) " ),
428- retry = false ,
429- verbose = c. verbose) do io
433+ " Range" => " bytes=$offset -$(offset+ length (data)- 1 ) "
434+ ];
435+ retry = false ,
436+ verbose = c. verbose) do io
430437 read! (io, data)
431438 end
432439 nothing
@@ -608,9 +615,10 @@ function Base.readdir(c::AzContainer; filterlist=true)
608615 r = @retry c. nretry HTTP. request (
609616 " GET" ,
610617 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) ?restype=container&comp=list&marker=$marker " ,
611- Dict (
618+ [
612619 " Authorization" => " Bearer $(token (c. session)) " ,
613- " x-ms-version" => API_VERSION),
620+ " x-ms-version" => API_VERSION
621+ ],
614622 retry = false )
615623 xroot = root (parse_string (String (r. body)))
616624 blobs = xroot[" Blobs" ][1 ][" Blob" ]
@@ -698,9 +706,10 @@ function containers(;storageaccount, session=AzSession(;lazy=true, scope=__OAUTH
698706 r = @retry nretry HTTP. request (
699707 " GET" ,
700708 " https://$storageaccount .blob.core.windows.net/?comp=list&marker=$marker " ,
701- Dict (
709+ [
702710 " Authorization" => " Bearer $(token (session)) " ,
703- " x-ms-version" => API_VERSION),
711+ " x-ms-version" => API_VERSION
712+ ],
704713 retry = false )
705714 xroot = root (parse_string (String (r. body)))
706715 containers = xroot[" Containers" ][1 ][" Container" ]
@@ -720,9 +729,10 @@ function Base.filesize(c::AzContainer, o::AbstractString)
720729 r = @retry c. nretry HTTP. request (
721730 " HEAD" ,
722731 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) /$(addprefix (c,o)) " ,
723- Dict (
732+ [
724733 " Authorization" => " Bearer $(token (c. session)) " ,
725- " x-ms-version" => API_VERSION),
734+ " x-ms-version" => API_VERSION
735+ ],
726736 retry = false )
727737 n = 0
728738 for header in r. headers
@@ -750,9 +760,10 @@ function Base.rm(c::AzContainer, o::AbstractString)
750760 @retry c. nretry HTTP. request (
751761 " DELETE" ,
752762 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) /$(addprefix (c,o)) " ,
753- Dict (
763+ [
754764 " Authorization" => " Bearer $(token (c. session)) " ,
755- " x-ms-version" => API_VERSION),
765+ " x-ms-version" => API_VERSION
766+ ],
756767 retry = false )
757768 catch
758769 @warn " error removing $(c. containername) /$(addprefix (c,o)) "
@@ -777,9 +788,10 @@ function Base.rm(c::AzContainer)
777788 @retry c. nretry HTTP. request (
778789 " DELETE" ,
779790 " https://$(c. storageaccount) .blob.core.windows.net/$(c. containername) ?restype=container" ,
780- Dict (
791+ [
781792 " Authorization" => " Bearer $(token (c. session)) " ,
782- " x-ms-version" => API_VERSION),
793+ " x-ms-version" => API_VERSION
794+ ],
783795 retry = false )
784796 end
785797
@@ -812,10 +824,11 @@ function Base.cp(src::AzContainer, dst::AzContainer)
812824 @retry dst. nretry HTTP. request (
813825 " PUT" ,
814826 " https://$(dst. storageaccount) .blob.core.windows.net/$(dst. containername) /$(addprefix (dst,blob)) " ,
815- Dict (
827+ [
816828 " Authorization" => " Bearer $(token (dst. session)) " ,
817829 " x-ms-version" => API_VERSION,
818- " x-ms-copy-source" => " https://$(src. storageaccount) .blob.core.windows.net/$(src. containername) /$(addprefix (src,blob)) " ),
830+ " x-ms-copy-source" => " https://$(src. storageaccount) .blob.core.windows.net/$(src. containername) /$(addprefix (src,blob)) "
831+ ],
819832 retry = false )
820833 end
821834 nothing
0 commit comments