File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ import {Buffer} from 'node:buffer';
3
3
import { promisify , inspect } from 'node:util' ;
4
4
import { URL , URLSearchParams } from 'node:url' ;
5
5
import { checkServerIdentity } from 'node:tls' ;
6
- import { request as httpRequest } from 'node:http' ;
7
- import { request as httpsRequest } from 'node:https' ;
6
+ // DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.
7
+ import http from 'node:http' ;
8
+ import https from 'node:https' ;
8
9
import type { Readable } from 'node:stream' ;
9
10
import type { Socket } from 'node:net' ;
10
11
import type { SecureContextOptions , DetailedPeerCertificate } from 'node:tls' ;
@@ -2447,10 +2448,10 @@ export default class Options {
2447
2448
return http2wrapper . auto as RequestFunction ;
2448
2449
}
2449
2450
2450
- return httpsRequest ;
2451
+ return https . request ;
2451
2452
}
2452
2453
2453
- return httpRequest ;
2454
+ return http . request ;
2454
2455
}
2455
2456
2456
2457
freeze ( ) {
You can’t perform that action at this time.
0 commit comments