File tree 2 files changed +4
-8
lines changed
packages/node/src/transports
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
import { Event , Response , TransportOptions } from '@sentry/types' ;
2
2
import { SentryError } from '@sentry/utils' ;
3
3
import * as http from 'http' ;
4
- import * as HttpsProxyAgent from 'https-proxy-agent' ;
5
4
6
5
import { BaseTransport } from './base' ;
7
6
@@ -10,11 +9,10 @@ export class HTTPTransport extends BaseTransport {
10
9
/** Create a new instance and set this.agent */
11
10
public constructor ( public options : TransportOptions ) {
12
11
super ( options ) ;
13
- this . module = http ;
14
12
const proxy = options . httpProxy || process . env . http_proxy ;
13
+ this . module = http ;
15
14
this . client = proxy
16
- ? // tslint:disable-next-line:no-unsafe-any
17
- ( new HttpsProxyAgent ( proxy ) as http . Agent )
15
+ ? ( new ( require ( 'https-proxy-agent' ) ) ( proxy ) as http . Agent ) // tslint:disable-line:no-unsafe-any
18
16
: new http . Agent ( { keepAlive : false , maxSockets : 30 , timeout : 2000 } ) ;
19
17
}
20
18
Original file line number Diff line number Diff line change 1
1
import { Event , Response , TransportOptions } from '@sentry/types' ;
2
2
import { SentryError } from '@sentry/utils' ;
3
3
import * as https from 'https' ;
4
- import * as HttpsProxyAgent from 'https-proxy-agent' ;
5
4
6
5
import { BaseTransport } from './base' ;
7
6
@@ -10,11 +9,10 @@ export class HTTPSTransport extends BaseTransport {
10
9
/** Create a new instance and set this.agent */
11
10
public constructor ( public options : TransportOptions ) {
12
11
super ( options ) ;
13
- this . module = https ;
14
12
const proxy = options . httpsProxy || options . httpProxy || process . env . https_proxy || process . env . http_proxy ;
13
+ this . module = https ;
15
14
this . client = proxy
16
- ? // tslint:disable-next-line:no-unsafe-any
17
- ( new HttpsProxyAgent ( proxy ) as https . Agent )
15
+ ? ( new ( require ( 'https-proxy-agent' ) ) ( proxy ) as https . Agent ) // tslint:disable-line:no-unsafe-any
18
16
: new https . Agent ( { keepAlive : false , maxSockets : 30 , timeout : 2000 } ) ;
19
17
}
20
18
You can’t perform that action at this time.
0 commit comments