Skip to content

allowH2 is not defined in buildConnector.BuildOptions #2333

@binsee

Description

@binsee

Bug Description

After undici added support for http2, allowH2 was added to the buildConnector parameters, but was not added to the type definition.

function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {

undici/lib/client.js

Lines 256 to 265 in 882ff6d

connect = buildConnector({
...tls,
maxCachedSessions,
allowH2,
socketPath,
timeout: connectTimeout,
...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
...connect
})
}

undici/lib/pool.js

Lines 55 to 64 in 882ff6d

connect = buildConnector({
...tls,
maxCachedSessions,
allowH2,
socketPath,
timeout: connectTimeout == null ? 10e3 : connectTimeout,
...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
...connect
})
}

declare namespace buildConnector {
export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
maxCachedSessions?: number | null;
socketPath?: string | null;
timeout?: number | null;
port?: number;
keepAlive?: boolean | null;
keepAliveInitialDelay?: number | null;
}

Reproducible By

Expected Behavior

Logs & Screenshots

Environment

  • undici 5.25.4

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions