Simplify header parsing
This commit is contained in:
parent
8ef2d2ecc4
commit
a156621297
@ -121,10 +121,8 @@ module Utils
|
|||||||
def parse_headers(headers)
|
def parse_headers(headers)
|
||||||
return {} unless headers
|
return {} unless headers
|
||||||
|
|
||||||
headers.split("\n").to_h do |h|
|
# Skip status code
|
||||||
partitioned = h.partition(": ")
|
headers.split("\r\n")[2..].to_h { |h| h.split(": ") }
|
||||||
[partitioned.first, partitioned.last]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def curl_download(*args, to: nil, try_partial: true, **options)
|
def curl_download(*args, to: nil, try_partial: true, **options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user