1iveowl/WebsocketClientLite.PCL

Sec-WebSocket-Protocol is aggregated wrong

Closed this issue · 1 comments

Hello,

Sec-WebSocket-Protocol is aggregated wrong

See:

.Aggregate("Sec-WebSocket-Protocol: ", (current, protocol) => $"{current}, {protocol}");

E.g: following line

List subprotocols = new List {"soap", "json"};

Will insert into the headers (wrong)

Sec-WebSocket-Protocol: , soap, json

Instead of (correct)

Sec-WebSocket-Protocol: soap, json

Possible solution:

var subprotocol = $"Sec-WebSocket-Protocol: {subprotocols.Aggregate((current, protocol) => $"{current}, {protocol}")}";

Good catch. It's been fixed. in version 4.14.