From 62d4403b43cb5a386d0da3d8ba886fadbbe274ae Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 19 Dec 2017 15:09:11 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Ext.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 )