Bug Description
H2CClient silently ignores invalid concurrency options instead of surfacing configuration errors.
Reproducible By
import { Client, H2CClient } from "undici";
try {
new Client("http://localhost", { maxConcurrentStreams: 0 });
} catch (err) {
console.log("Client throws:", err.constructor.name, err.message);
}
const h2c = new H2CClient("http://localhost", {
maxConcurrentStreams: 0,
pipelining: 0,
});
console.log("H2CClient pipelining:", h2c.pipelining);
h2c.close();
Expected Behavior
H2CClient should not silently replace invalid user-provided concurrency options with defaults.
Expected behavior should be consistent with Client validation, especially for maxConcurrentStreams:
new H2CClient('http://localhost', { maxConcurrentStreams: 0 })
// should throw InvalidArgumentError
For pipelining, H2CClient should either reject invalid values explicitly or otherwise preserve the same semantics as Client instead of converting provided values such as 0 to the default 100.
Logs & Screenshots
Client throws: InvalidArgumentError maxConcurrentStreams must be a positive integer, greater than 0
H2CClient pipelining: 100
Environment
macOS 26.4.1
Node v24.15.0
undici v8.1.0
Bug Description
H2CClientsilently ignores invalid concurrency options instead of surfacing configuration errors.Reproducible By
Expected Behavior
H2CClient should not silently replace invalid user-provided concurrency options with defaults.
Expected behavior should be consistent with Client validation, especially for maxConcurrentStreams:
For pipelining, H2CClient should either reject invalid values explicitly or otherwise preserve the same semantics as Client instead of converting provided values such as
0to the default100.Logs & Screenshots
Environment
macOS 26.4.1
Node v24.15.0
undici v8.1.0