From 70bf799c20714533168650345f0bee5ef0511bba Mon Sep 17 00:00:00 2001 From: sta Date: Sun, 24 Dec 2017 04:08:42 +0900 Subject: [PATCH] [Modify] To internal --- websocket-sharp/Ext.cs | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 9e7a5538..0f1ab909 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -388,6 +388,16 @@ namespace WebSocketSharp return idx > 0 ? original.Substring (0, idx) : original; } + internal static CookieCollection GetCookies ( + this NameValueCollection headers, bool response + ) + { + var val = headers[response ? "Set-Cookie" : "Cookie"]; + return val != null + ? CookieCollection.Parse (val, response) + : new CookieCollection (); + } + internal static string GetDnsSafeHost (this Uri uri, bool bracketIPv6) { return bracketIPv6 && uri.HostNameType == UriHostNameType.IPv6 @@ -1148,27 +1158,6 @@ namespace WebSocketSharp eventHandler (sender, e); } - /// - /// Gets the collection of the HTTP cookies from the specified HTTP . - /// - /// - /// A that receives a collection of the HTTP cookies. - /// - /// - /// A that contains a collection of the HTTP headers. - /// - /// - /// true if is a collection of the response headers; - /// otherwise, false. - /// - public static CookieCollection GetCookies (this NameValueCollection headers, bool response) - { - var name = response ? "Set-Cookie" : "Cookie"; - return headers != null && headers.Contains (name) - ? CookieCollection.Parse (headers[name], response) - : new CookieCollection (); - } - /// /// Gets the description of the specified HTTP status . ///