On certain browsers and servers, sending an undefined protocol can break the handshake as protocol is sent with undefined value.
WebSocket connection to 'ws://server/socket' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received
When protocol is falsy, we then avoid to include it in the WebSocket constructor. It let the browser define protocol as empty string, which is valid and doesn't break anymore.
@pladaria
Context
On certain browsers and servers, sending an undefined protocol can break the handshake as protocol is sent with
undefined
value.Fix
When protocol is falsy, we then avoid to include it in the
WebSocket
constructor. It let the browser define protocol as empty string, which is valid and doesn't break anymore.