Support HTTP/2 responses
This commit is contained in:
parent
361e0e52e0
commit
b99a6ec8b2
@ -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 })
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user