geturl: Accept an arrayref for headers

This commit is contained in:
Richard Hansen 2024-06-07 02:19:22 -04:00
parent b9144c01c2
commit bdc69d879f

View file

@ -2873,7 +2873,7 @@ sub geturl {
push(@curlopt, "url=\"".escape_curl_param("${protocol}://${server}/${url}").'"');
# Each header line is added individually
@header_lines = split('\n', $headers);
@header_lines = ref($headers) eq 'ARRAY' ? @$headers : split('\n', $headers);
$_ = "header=\"".escape_curl_param($_).'"' for (@header_lines);
push(@curlopt, @header_lines);