File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 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';
33import { promisify , inspect } from 'node:util' ;
44import { URL , URLSearchParams } from 'node:url' ;
55import { 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' ;
89import type { Readable } from 'node:stream' ;
910import type { Socket } from 'node:net' ;
1011import type { SecureContextOptions , DetailedPeerCertificate } from 'node:tls' ;
@@ -2447,10 +2448,10 @@ export default class Options {
24472448 return http2wrapper . auto as RequestFunction ;
24482449 }
24492450
2450- return httpsRequest ;
2451+ return https . request ;
24512452 }
24522453
2453- return httpRequest ;
2454+ return http . request ;
24542455 }
24552456
24562457 freeze ( ) {
You can’t perform that action at this time.
0 commit comments