Skip to content
Snippets Groups Projects
Commit a1566212 authored by cnnrmnn's avatar cnnrmnn
Browse files

Simplify header parsing

parent 8ef2d2ec
No related branches found
No related tags found
No related merge requests found
......@@ -121,10 +121,8 @@ module Utils
def parse_headers(headers)
return {} unless headers
headers.split("\n").to_h do |h|
partitioned = h.partition(": ")
[partitioned.first, partitioned.last]
end
# Skip status code
headers.split("\r\n")[2..].to_h { |h| h.split(": ") }
end
def curl_download(*args, to: nil, try_partial: true, **options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment