private void ParseResponseHeaders(string rawHeaders) { var lines = Regex.Split(rawHeaders, Constants.CRLF); SetResponseStatus(lines[0]); for (var i = 1; i < lines.Length; i++) { var headerValuePair = Regex.Split(lines[i], ": "); if (CheckAndSetCookie(headerValuePair)) { continue; } Headers.AddOrUpdate(headerValuePair[0], headerValuePair[1]); } }
internal void AddHeader(string name, string value) { Headers.AddOrUpdate(name, value, (n, v) => value); }