public static function parseHeaders($content, AbstractMessage $message)
    {
        $namespace = explode('\\', get_class($message));
        $name = strtoupper(array_pop($namespace));

        if (strpos($content, 'HTTP/') === 0 || strpos($content, $name) === 0) {
            $line = self::nibbleLine($content);
            if (preg_match('/^HTTP\/[0-9]{1}\.[0-9]{1} (?P<code>[0-9]+) (?P<message>.*)$/', $line, $matches) &&
                $matches["code"] == "100"
            ) {
                self::nibbleLine($content);
            }
            while (($line = self::nibbleLine($content)) != "") {
                if (preg_match('/^([A-Za-z\-]+): (.*)/', $line, $matches)) {
                    $message->addHeader($matches[1], $matches[2]);
                }
            }
        }

        return $content;
    }