mirror of
https://github.com/denoland/deno.git
synced 2025-02-01 20:25:12 -05:00
fix(node/http): export globalAgent (#21081)
Fixes #21080 Fixes #18312 --------- Signed-off-by: Jacob Hummer <jcbhmr@outlook.com>
This commit is contained in:
parent
407230fec3
commit
f155ca7a62
3 changed files with 27 additions and 1 deletions
|
@ -812,3 +812,27 @@ Deno.test(
|
|||
await server.finished;
|
||||
},
|
||||
);
|
||||
|
||||
Deno.test("[node/http] node:http exports globalAgent", async () => {
|
||||
const http = await import("node:http");
|
||||
assert(
|
||||
http.globalAgent,
|
||||
"node:http must export 'globalAgent' on module namespace",
|
||||
);
|
||||
assert(
|
||||
http.default.globalAgent,
|
||||
"node:http must export 'globalAgent' on module default export",
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("[node/https] node:https exports globalAgent", async () => {
|
||||
const https = await import("node:https");
|
||||
assert(
|
||||
https.globalAgent,
|
||||
"node:https must export 'globalAgent' on module namespace",
|
||||
);
|
||||
assert(
|
||||
https.default.globalAgent,
|
||||
"node:https must export 'globalAgent' on module default export",
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1764,6 +1764,7 @@ export function get(...args: any[]) {
|
|||
export {
|
||||
Agent,
|
||||
ClientRequest,
|
||||
globalAgent,
|
||||
IncomingMessageForServer as IncomingMessage,
|
||||
METHODS,
|
||||
OutgoingMessage,
|
||||
|
@ -1771,6 +1772,7 @@ export {
|
|||
};
|
||||
export default {
|
||||
Agent,
|
||||
globalAgent,
|
||||
ClientRequest,
|
||||
STATUS_CODES,
|
||||
METHODS,
|
||||
|
|
|
@ -104,7 +104,7 @@ export class Agent extends HttpAgent {
|
|||
}
|
||||
}
|
||||
|
||||
const globalAgent = new Agent({
|
||||
export const globalAgent = new Agent({
|
||||
keepAlive: true,
|
||||
scheduling: "lifo",
|
||||
timeout: 5000,
|
||||
|
|
Loading…
Add table
Reference in a new issue