[Modify] Polish it
This commit is contained in:
parent
a3f6fedd81
commit
ad8ce4a5e5
@ -224,10 +224,16 @@ namespace WebSocketSharp.Net.WebSockets
|
|||||||
/// </value>
|
/// </value>
|
||||||
public override IEnumerable<string> SecWebSocketProtocols {
|
public override IEnumerable<string> SecWebSocketProtocols {
|
||||||
get {
|
get {
|
||||||
var protocols = _context.Request.Headers["Sec-WebSocket-Protocol"];
|
var val = _context.Request.Headers["Sec-WebSocket-Protocol"];
|
||||||
if (protocols != null) {
|
if (val == null || val.Length == 0)
|
||||||
foreach (var protocol in protocols.Split (','))
|
yield break;
|
||||||
yield return protocol.Trim ();
|
|
||||||
|
foreach (var elm in val.Split (',')) {
|
||||||
|
var protocol = elm.Trim ();
|
||||||
|
if (protocol.Length == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
yield return protocol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user