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