Support HTTP/2 responses

master
Přemysl Eric Janouch 3 years ago
parent 361e0e52e0
commit b99a6ec8b2
Signed by: p
GPG Key ID: A0420B94F92B9493

@ -57,7 +57,7 @@ sub get {
my $resp = communicate(@args, $url, $data);
die 'cannot download' if $? >> 8;
my ($code, $headers, $body) =
$resp =~ m#\AHTTP/\d\.\d (\d+) .*?\r\n(.*?)\r\n\r\n(.*)#sm;
$resp =~ m#\AHTTP/\d(?:\.\d)? (\d+) .*?\r\n(.*?)\r\n\r\n(.*)#sm;
return ($code, $body, { $headers =~ /(\S+?): (.*)\r\n/mg })
}