Fixed parsing the host header field
[mono.git] / mcs / class / System.Net.Http / System.Net.Http.Headers / HttpHeaderValueCollection.cs
index 689ef818680b55ab172745abcb0b8aa0a1f25921..72c4299e64ad4c8eb85239f9d849037435a10de0 100644 (file)
@@ -61,6 +61,11 @@ namespace System.Net.Http.Headers
                        list.Add (item);
                }
 
+               internal void AddRange (List<T> values)
+               {
+                       list.AddRange (values);
+               }
+
                public void Clear ()
                {
                        list.Clear ();
@@ -86,6 +91,15 @@ namespace System.Net.Http.Headers
                        return list.Remove (item);
                }
 
+               public override string ToString ()
+               {
+                       // This implementation prints different values than
+                       // what .NET does when one of the values is invalid
+                       // But it better represents what is actually hold by
+                       // the collection
+                       return string.Join (headerInfo.Separator, list);
+               }
+
                public bool TryParseAdd (string input)
                {
                        return headers.AddValue (input, headerInfo, true);