This commit is contained in:
2021-03-31 11:29:23 +08:00
parent 03c7e7215a
commit 95637d0248
+1 -1
View File
@@ -136,7 +136,7 @@ class Http2 extends Component
/** @var Response $response */
$response = $client->recv();
if ($response === false || $response->statusCode > 200) {
throw new Exception($client->errMsg, $response->statusCode);
throw new Exception($client->errMsg, $response->statusCode ?? 500);
}
$header = $response->headers['content-type'];
if (str_starts_with($header, 'application/json;')) {