utils/curl: add comment detailing options handling
This commit is contained in:
parent
b980fa1c91
commit
03a72760ef
@ -304,6 +304,8 @@ module Utils
|
|||||||
)
|
)
|
||||||
file = Tempfile.new.tap(&:close)
|
file = Tempfile.new.tap(&:close)
|
||||||
|
|
||||||
|
# Convert specs to options. This is mostly key-value options,
|
||||||
|
# unless the value is a boolean in which case treat as as flag.
|
||||||
specs = specs.flat_map do |option, argument|
|
specs = specs.flat_map do |option, argument|
|
||||||
next [] if argument == false # No flag.
|
next [] if argument == false # No flag.
|
||||||
|
|
||||||
@ -311,6 +313,7 @@ module Utils
|
|||||||
args << argument unless argument == true # It's a flag.
|
args << argument unless argument == true # It's a flag.
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
|
|
||||||
max_time = hash_needed ? 600 : 25
|
max_time = hash_needed ? 600 : 25
|
||||||
output, _, status = curl_output(
|
output, _, status = curl_output(
|
||||||
*specs, "--dump-header", "-", "--output", file.path, "--location", url,
|
*specs, "--dump-header", "-", "--output", file.path, "--location", url,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user