static bool AppendResult( string line, ref string currentRequestLine, HttpHeaderEntries currentEntries) { string key, value; // We found a blank line! Header ends here. if (string.IsNullOrWhiteSpace(line)) { return(false); } // We found a request line else if (currentRequestLine == null) { currentRequestLine = line; } // We found a header key:value line else { HttpHeaderLineParser.Parse(line, out key, out value); currentEntries.Add(key, value); } return(true); }
public static void CopyEntries(this HttpHeaderEntries to, HttpHeaderEntries from) { if (to == null) { throw new ArgumentNullException(nameof(to)); } if (from == null) { throw new ArgumentNullException(nameof(from)); } foreach (var key in from.Keys) { var values = from.Get(key, false); for (int i = 0; i < values.Count; i++) { string value = values[i]; to.Add(key, value); } } }
public virtual void Add(StringCI key, string value) { _entries.Add(key, value); InvalidCachedPlainText(); }