protected function getRequestHeaders($response)
    {
        $eol = stripos($response, "\r\n");

        if ($eol === false) {
            throw new InvalidArgumentException('Invalid request line');
        }

        $request = substr($response, 0, $eol);
        $headers = $this->getHeaders(substr($response, $eol + 2));

        return [$request, $headers];
    }