The socket connection to the DevServer started failing. The server error is websocket connection invalid which results in error WebSocketErrorDomain error 2 in the SDK.
The errors are caused by changes/rewriting to the request headers and the response.
The server expects Upgrade: WebSocket but receives Upgrade: websocket (The SDK does send Upgrade: WebSocket). This is fixed on the server.
The SDK expects a specific response and headers (direct comparison) but receives:
Background
The socket connection to the DevServer started failing. The server error is
websocket connection invalid
which results in errorWebSocketErrorDomain error 2
in the SDK. The errors are caused by changes/rewriting to the request headers and the response.Upgrade: WebSocket
but receivesUpgrade: websocket
(The SDK does sendUpgrade: WebSocket
). This is fixed on the server.Implementation
Change the check for successful handshake. Parse the response and validate the status code, Upgrade and Connection headers.
Testing steps
Manual testing the dev server connection. Unit tests.
Is this change backwards-compatible?
Yes