Handle regex not finding anything
This commit is contained in:
parent
b0124c4fb0
commit
6db1b0abd8
@ -60,7 +60,7 @@ def curl_download(*args, to: nil, **options)
|
|||||||
supports_partial_download = http_status.to_i == 206 # Partial Content
|
supports_partial_download = http_status.to_i == 206 # Partial Content
|
||||||
if supports_partial_download &&
|
if supports_partial_download &&
|
||||||
destination.exist? &&
|
destination.exist? &&
|
||||||
destination.size == %r{^.*Content-Range: bytes \d+-\d+/(\d+)\r\n.*$}m.match(headers)[1].to_i
|
destination.size == %r{^.*Content-Range: bytes \d+-\d+/(\d+)\r\n.*$}m.match(headers)&.[](1)&.to_i
|
||||||
return # We've already downloaded all the bytes
|
return # We've already downloaded all the bytes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user