-
-
Notifications
You must be signed in to change notification settings - Fork 669
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Reproducible By
Consider this code:
async function test() {
const undici = require('undici');
class CustomAgent extends undici.Agent {
constructor() {
super({
keepAliveTimeout: 10,
keepAliveMaxTimeout: 10
});
}
dispatch(options, handler) {
console.log("DISPATCH");
return super.dispatch(options, handler);
}
}
const request = new undici.Request("https://example.org", {
dispatcher: new CustomAgent()
});
// will make an HTTP call and print "DISPATCH"
await undici.fetch(request);
// will make an HTTP call, but not print "DISPATCH"
await undici.fetch(request.clone());
}
test();
Expected Behavior
In the code above, I would expect both fetch
calls to use the dispatcher.
Logs & Screenshots
none.
Environment
NodeJS, Version v22.9.0
Additional context
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working