From 0bc6833114ae1c94863aa5d8637189c2ac7f665a Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 10 Dec 2018 21:48:10 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Net/CookieCollection.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/websocket-sharp/Net/CookieCollection.cs b/websocket-sharp/Net/CookieCollection.cs index cbfe39fa..0aaf456a 100644 --- a/websocket-sharp/Net/CookieCollection.cs +++ b/websocket-sharp/Net/CookieCollection.cs @@ -403,6 +403,25 @@ namespace WebSocketSharp.Net return new List (value.SplitHeaderValue (',', ';')).ToArray (); } + private static string urlDecode (string s, Encoding encoding) + { + if (s == null) + return s; + + if (s.Length == 0) + return s; + + if (s.IndexOfAny (new[] { '%', '+' }) == -1) + return s; + + try { + return HttpUtility.UrlDecode (s, encoding); + } + catch { + return null; + } + } + #endregion #region Internal Methods