Fix for subprotocols for server
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2012-2013 sta.blockhead
|
||||
* Copyright (c) 2012-2014 sta.blockhead
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -241,7 +241,7 @@ namespace WebSocketSharp.Net.WebSockets
|
||||
/// WebSocket connection request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property represents the subprotocols of the WebSocket connection.
|
||||
/// This property represents the subprotocols requested from the client.
|
||||
/// </remarks>
|
||||
/// <value>
|
||||
/// An IEnumerable<string> that contains the values of the
|
||||
@@ -249,7 +249,10 @@ namespace WebSocketSharp.Net.WebSockets
|
||||
/// </value>
|
||||
public override IEnumerable<string> SecWebSocketProtocols {
|
||||
get {
|
||||
return _context.Request.Headers.GetValues ("Sec-WebSocket-Protocol");
|
||||
var protocols = _context.Request.Headers ["Sec-WebSocket-Protocol"];
|
||||
if (protocols != null)
|
||||
foreach (var protocol in protocols.Split (','))
|
||||
yield return protocol.Trim ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -251,7 +251,7 @@ namespace WebSocketSharp.Net.WebSockets
|
||||
/// WebSocket connection request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property represents the subprotocols of the WebSocket connection.
|
||||
/// This property represents the subprotocols requested from the client.
|
||||
/// </remarks>
|
||||
/// <value>
|
||||
/// An IEnumerable<string> that contains the values of the
|
||||
@@ -259,7 +259,10 @@ namespace WebSocketSharp.Net.WebSockets
|
||||
/// </value>
|
||||
public override IEnumerable<string> SecWebSocketProtocols {
|
||||
get {
|
||||
return _request.Headers.GetValues ("Sec-WebSocket-Protocol");
|
||||
var protocols = _request.Headers ["Sec-WebSocket-Protocol"];
|
||||
if (protocols != null)
|
||||
foreach (var protocol in protocols.Split (','))
|
||||
yield return protocol.Trim ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2012-2013 sta.blockhead
|
||||
* Copyright (c) 2012-2014 sta.blockhead
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -173,7 +173,7 @@ namespace WebSocketSharp.Net.WebSockets
|
||||
/// WebSocket connection request.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property represents the subprotocols of the WebSocket connection.
|
||||
/// This property represents the subprotocols requested from the client.
|
||||
/// </remarks>
|
||||
/// <value>
|
||||
/// An IEnumerable<string> that contains the values of the
|
||||
|
Reference in New Issue
Block a user