diff --git a/src/Curl/Easy.jl b/src/Curl/Easy.jl index 7e2d466..0dd1108 100644 --- a/src/Curl/Easy.jl +++ b/src/Curl/Easy.jl @@ -252,11 +252,13 @@ function get_response_info(easy::Easy) for hdr in easy.res_hdrs if contains(hdr, r"^\s*$") # ignore - elseif (m = match(r"^(HTTP/\d+(?:.\d+)?\s+\d+\b.*?)\s*$", hdr)) !== nothing - message = m.captures[1] + elseif (m = match(r"^(HTTP/\d+(?:.\d+)?\s+\d+\b.*?)\s*$", hdr); m) !== nothing + message = m.captures[1]::SubString{String} empty!(headers) - elseif (m = match(r"^(\S[^:]*?)\s*:\s*(.*?)\s*$", hdr)) !== nothing - push!(headers, lowercase(m.captures[1]) => m.captures[2]) + elseif (m = match(r"^(\S[^:]*?)\s*:\s*(.*?)\s*$", hdr); m) !== nothing + key = lowercase(m.captures[1]::SubString{String}) + val = m.captures[2]::SubString{String} + push!(headers, key => val) else @warn "malformed HTTP header" url status header=hdr end diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl index 238aa4a..eb16d00 100644 --- a/src/Curl/Multi.jl +++ b/src/Curl/Multi.jl @@ -55,7 +55,7 @@ end function remove_handle(multi::Multi, easy::Easy) lock(multi.lock) do @check curl_multi_remove_handle(multi.handle, easy.handle) - deleteat!(multi.easies, findlast(==(easy), multi.easies)) + deleteat!(multi.easies, findlast(==(easy), multi.easies)::Int) !isempty(multi.easies) && return cleanup_cb = @cfunction(cleanup_callback, Cvoid, (Ptr{Cvoid},)) if multi.grace <= 0 diff --git a/src/Downloads.jl b/src/Downloads.jl index 6b73be3..6a6c5cb 100644 --- a/src/Downloads.jl +++ b/src/Downloads.jl @@ -228,7 +228,7 @@ function download( progress = progress, verbose = verbose, downloader = downloader, - ) + )::Response status_ok(response.proto, response.status) && return output throw(RequestError(url, Curl.CURLE_OK, "", response)) end