Allow HTTP/2 status responses (#695)

Fixed #672 and resolved #669.
This commit is contained in:
Michael 2019-05-19 03:12:54 +02:00 committed by TimZ99
parent e2d904688a
commit 6761776a8f
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
1 changed files with 6 additions and 6 deletions

View File

@ -253,18 +253,18 @@ class StatusUpdater {
// the first line would be the status code..
$status_code = strtok($curl_result, "\r\n");
// keep it general
// $code[1][0] = status code
// $code[2][0] = name of status code
// $code[2][0] = status code
// $code[3][0] = name of status code
$code_matches = array();
preg_match_all("/[A-Z]{2,5}\/\d\.\d\s(\d{3})\s(.*)/", $status_code, $code_matches);
preg_match_all("/[A-Z]{2,5}\/\d(\.\d)?\s(\d{3})\s?(.*)/", $status_code, $code_matches);
if (empty($code_matches[0])) {
if(empty($code_matches[0])) {
// somehow we dont have a proper response.
$this->error = 'TIMEOUT ERROR: no response from server';
$result = false;
} else {
$code = $code_matches[1][0];
$msg = $code_matches[2][0];
$code = $code_matches[2][0];
$msg = $code_matches[3][0];
$allow_http_status = explode("|", $this->server['allow_http_status']);
// All status codes starting with a 4 or higher mean trouble!