You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The protocol property of the W3CWebSocket object returns undefined in some cases while browsers will return empty string instead.
From the spec, I don't think we should ever expect the protocol property to return undefined. Ie the protocol value is empty string unless the server replies with a non-null subprotocol value and then the value is updated to a new string.
I ran into this trying to re-use some browser JS code in node.js and had to create the following shim to prevent errors:
The
protocol
property of the W3CWebSocket object returnsundefined
in some cases while browsers will return empty string instead.From the spec, I don't think we should ever expect the protocol property to return undefined. Ie the protocol value is empty string unless the server replies with a non-null subprotocol value and then the value is updated to a new string.
I ran into this trying to re-use some browser JS code in node.js and had to create the following shim to prevent errors:
The text was updated successfully, but these errors were encountered: