|
|
|
@ -1470,7 +1470,9 @@ namespace WebSocketSharp
|
|
|
|
/// <exception cref="ArgumentException">
|
|
|
|
/// <exception cref="ArgumentException">
|
|
|
|
/// <paramref name="protocol"/> is empty.
|
|
|
|
/// <paramref name="protocol"/> is empty.
|
|
|
|
/// </exception>
|
|
|
|
/// </exception>
|
|
|
|
public static bool IsUpgradeTo (this HttpListenerRequest request, string protocol)
|
|
|
|
public static bool IsUpgradeTo (
|
|
|
|
|
|
|
|
this HttpListenerRequest request, string protocol
|
|
|
|
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (request == null)
|
|
|
|
if (request == null)
|
|
|
|
throw new ArgumentNullException ("request");
|
|
|
|
throw new ArgumentNullException ("request");
|
|
|
|
@ -1481,8 +1483,9 @@ namespace WebSocketSharp
|
|
|
|
if (protocol.Length == 0)
|
|
|
|
if (protocol.Length == 0)
|
|
|
|
throw new ArgumentException ("An empty string.", "protocol");
|
|
|
|
throw new ArgumentException ("An empty string.", "protocol");
|
|
|
|
|
|
|
|
|
|
|
|
return request.Headers.Contains ("Upgrade", protocol) &&
|
|
|
|
var headers = request.Headers;
|
|
|
|
request.Headers.Contains ("Connection", "Upgrade");
|
|
|
|
return headers.Contains ("Upgrade", protocol)
|
|
|
|
|
|
|
|
&& headers.Contains ("Connection", "Upgrade");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
|