curl usage: support HTTP/2 response code header
This commit is contained in:
parent
ffa39719a1
commit
6b76ce6f62
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ public static function getLatestGitVersionCode($url, $timeout = 2)
|
|||
{
|
||||
list($headers, $data) = get_http_response($url, $timeout);
|
||||
|
||||
if (strpos($headers[0], '200 OK') === false) {
|
||||
if (preg_match('#HTTP/[\d\.]+ 200(?: OK)?#', $headers[0]) !== 1) {
|
||||
error_log('Failed to retrieve ' . $url);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue