[Modify] Polish it
This commit is contained in:
parent
f2827c1f50
commit
7d3255aa4b
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user