Fix support for HTTP/2 in MultiHttpClient
[lhc/web/wiklou.git] / includes / libs / MultiHttpClient.php
index dd8772c..7594da2 100644 (file)
@@ -375,7 +375,7 @@ class MultiHttpClient implements LoggerAwareInterface {
                                }
                                $length = strlen( $header );
                                $matches = [];
-                               if ( preg_match( "/^(HTTP\/1\.[01]) (\d{3}) (.*)/", $header, $matches ) ) {
+                               if ( preg_match( "/^(HTTP\/(?:1\.[01]|2)) (\d{3}) (.*)/", $header, $matches ) ) {
                                        $req['response']['code'] = (int)$matches[2];
                                        $req['response']['reason'] = trim( $matches[3] );
                                        return $length;