HTTP headers are the name or value pairs that are displayed in the request and response messages of message headers for Hypertext Transfer Protocol (HTTP). Usually, the header name and the value are separated by a single colon. HTTP headers are an integral part of HTTP requests and responses.
In simpler terms, HTTP headers are the code that transfers data between a Web server and a browser. HTTP headers are mainly intended for the communication between the server and client in both directions.
What is HTTP/2?
In 2015, Internet Engineering Task Force (IETF) release HTTP/2, the second major version of the most useful internet protocol, HTTP. It was derived from the earlier experimental SPDY protocol.
This error occurred after recent magento version release and http version changed from 1.1 to 2. Magento parsing still to 1.1.
To solve this problem, You need to change lib/Zend/Http/Response.php
- Change function function extractHeaders($response_str) replace lines
if ($index === 0 && preg_match('#^HTTP/\d+(?:.\d+) [1-5]\d+#', $line)) { // Status line; ignore continue; }
to
if ($index === 0 || preg_match('#^HTTP/\d+(?:.\d+) [1-5]\d+#', $line)) { // Status line; ignore continue; }
- Function extractVersion($response_str)
public static function extractVersion($response_str) { return "1.1"; preg_match("|^HTTP/([\d\.x]+) \d+|", $response_str, $m); if (isset($m[1])) { return $m[1]; } else { return false; } }