internal static Dictionary<string, string> ParseHTTPHeaderString(string input)
{
if (input == null)
{
throw new ArgumentException("input was null to ParseHTTPHeaderString");
}
Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
StringReader reader = new StringReader(input);
int num = 0;
while (true)
{
string str = reader.ReadLine();
if (str == null)
{
return dictionary;
}
if ((num++ == 0) && str.StartsWith("HTTP"))
{
dictionary["STATUS"] = str;
}
else
{
int index = str.IndexOf(": ");
if (index != -1)
{
string str4;
string key = str.Substring(0, index).ToUpper();
string str3 = str.Substring(index + 2);
if (dictionary.TryGetValue(key, out str4))
{
str3 = str4 + "," + str3;
}
dictionary[key] = str3;
}
}
}
}