private function parseHeaders($header)
    {
        $lines = explode("\n", $header);
        $headers = [];
        foreach ($lines as $line) {
            if (strpos($line, ':') === false) {
                continue;
            }

            $middle=explode(":", $line);
            $headers[trim($middle[0])] = trim($middle[1]);
        }
        return $headers;
    }