/** * */ protected function parseHeader($rawHeader) { $lines = explode("\r\n", $rawHeader); preg_match('/^http\\/(1\\.0|1\\.1)/i', array_shift($lines), $matches); $this->protocolVersion = $matches[1]; $headers = []; foreach ($lines as $line) { $header = explode(':', $line, 2); $headerName = Headers::processName($header[0]); $headers[$headerName] = trim($header[1]); } $this->setHeaders($headers); }