Skip to content

socket.io-client - transports options array modified from [string] to [object] by io constructor #5462

@esellier

Description

@esellier

Describe the bug

const options = {transports: ["websocket","polling"]};
const s = io(<URL>, options);

options object is modified, and transports is set to [ class WS, class XHR ]
Not really a big issue, but quite unexpected and an unusual behaviour. Especially when you need to serialize the options object after connection.

Expected behavior
options object should not be mutated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    to triageWaiting to be triaged by a member of the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions