From 6e68eade57b9a6b22d46fa9413ef03729fd872fa Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 23 Dec 2017 16:26:26 +0900 Subject: [PATCH] [Modify] Move it --- websocket-sharp/Ext.cs | 44 ---------------------- websocket-sharp/Net/HttpListenerRequest.cs | 5 +++ 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 1f32ef8f..9eadcefd 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -1473,50 +1473,6 @@ namespace WebSocketSharp return false; } - /// - /// Determines whether the specified HTTP request is an upgrade request to - /// switch to the specified protocol. - /// - /// - /// true if is an upgrade request to - /// switch to ; otherwise, false. - /// - /// - /// A to test. - /// - /// - /// A that specifies the name of the protocol. - /// - /// - /// - /// is . - /// - /// - /// -or- - /// - /// - /// is . - /// - /// - /// - /// is an empty string. - /// - public static bool IsUpgradeRequest ( - this HttpListenerRequest request, string protocol - ) - { - if (request == null) - throw new ArgumentNullException ("request"); - - if (protocol == null) - throw new ArgumentNullException ("protocol"); - - if (protocol.Length == 0) - throw new ArgumentException ("An empty string.", "protocol"); - - return request.Headers.Upgrades (protocol); - } - /// /// Determines whether the specified string is a URI string. /// diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index fe72aa88..34d9aa8a 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -610,6 +610,11 @@ namespace WebSocketSharp.Net } } + internal bool IsUpgradeRequest (string protocol) + { + return _headers.Upgrades (protocol); + } + internal void SetRequestLine (string requestLine) { var parts = requestLine.Split (new[] { ' ' }, 3);