Add header parsing
This commit is contained in:
parent
aa989bd55a
commit
b9b917756c
@ -118,6 +118,13 @@ module Utils
|
|||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def parse_headers(headers)
|
||||||
|
headers.split("\n").to_h do |h|
|
||||||
|
partitioned = h.partition(": ")
|
||||||
|
[partitioned.first, partitioned.last]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def curl_download(*args, to: nil, try_partial: true, **options)
|
def curl_download(*args, to: nil, try_partial: true, **options)
|
||||||
destination = Pathname(to)
|
destination = Pathname(to)
|
||||||
destination.dirname.mkpath
|
destination.dirname.mkpath
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user