diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 310e1e9b..11422f05 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -197,6 +197,25 @@ namespace WebSocketSharp : stream.ToByteArray (); } + internal static bool Contains ( + this NameValueCollection collection, + string name, + string value, + StringComparison comparisonTypeForValue + ) + { + var val = collection[name]; + if (val == null) + return false; + + foreach (var elm in val.Split (',')) { + if (elm.Trim ().Equals (value, comparisonTypeForValue)) + return true; + } + + return false; + } + internal static bool Contains ( this IEnumerable source, Func condition )