Fix an issue with the websocket upgrade