File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
hardhat-core/src/internal/util
hardhat-verify/src/internal Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ export async function download(
24
24
timeoutMillis = 10000 ,
25
25
extraHeaders : { [ name : string ] : string } = { }
26
26
) {
27
- const { getGlobalDispatcher , ProxyAgent, request } = await import ( "undici" ) ;
27
+ const { Agent , ProxyAgent, request } = await import ( "undici" ) ;
28
28
29
29
let dispatcher : Dispatcher ;
30
30
if ( process . env . http_proxy !== undefined && shouldUseProxy ( url ) ) {
31
31
dispatcher = new ProxyAgent ( process . env . http_proxy ) ;
32
32
} else {
33
- dispatcher = getGlobalDispatcher ( ) ;
33
+ dispatcher = new Agent ( ) ;
34
34
}
35
35
36
36
const hardhatVersion = getHardhatVersion ( ) ;
Original file line number Diff line number Diff line change @@ -29,13 +29,12 @@ export async function sendPostRequest(
29
29
}
30
30
31
31
function getDispatcher ( ) : Undici . Dispatcher {
32
- const { ProxyAgent, getGlobalDispatcher } =
33
- require ( "undici" ) as typeof Undici ;
32
+ const { ProxyAgent, Agent } = require ( "undici" ) as typeof Undici ;
34
33
if ( process . env . http_proxy !== undefined ) {
35
34
return new ProxyAgent ( process . env . http_proxy ) ;
36
35
}
37
36
38
- return getGlobalDispatcher ( ) ;
37
+ return new Agent ( ) ;
39
38
}
40
39
41
40
export function isSuccessStatusCode ( statusCode : number ) : boolean {
You can’t perform that action at this time.
0 commit comments