Skip to content

socketPath option is not passed to the connect function #3486

Open
@zdm

Description

@zdm

Bug Description

In Pool dispatcher socketPath option is not passed to the connect if connect is a function.

Reproducible By

const dispatcher = new Agent ( {
    socketPath: "/var/run/socket",
    connect ( options, callback ) {
        console.log( options );
        process.exit();
    }
} )

await fetch( "http://local/", {
    dispatcher
} );

Expected Behavior

Expecting to see socketPath in options, passed to the connect function.

When connect is specified as object - it works, but for function you just forget to pass socketPath.

Logs & Screenshots

Environment

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions