@@ -11783,7 +11783,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11783
11783
} ) ;
11784
11784
} ;
11785
11785
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
11786
- exports . HttpClient = exports . isHttps = exports . HttpClientResponse = exports . HttpCodes = void 0 ;
11786
+ exports . HttpClient = exports . HttpClientResponse = exports . HttpCodes = void 0 ;
11787
+ exports . isHttps = isHttps ;
11787
11788
const url = __nccwpck_require__ ( 7310 ) ;
11788
11789
const http = __nccwpck_require__ ( 3685 ) ;
11789
11790
const https = __nccwpck_require__ ( 5687 ) ;
@@ -11863,7 +11864,6 @@ function isHttps(requestUrl) {
11863
11864
let parsedUrl = url . parse ( requestUrl ) ;
11864
11865
return parsedUrl . protocol === 'https:' ;
11865
11866
}
11866
- exports . isHttps = isHttps ;
11867
11867
var EnvironmentVariables ;
11868
11868
( function ( EnvironmentVariables ) {
11869
11869
EnvironmentVariables [ "HTTP_PROXY" ] = "HTTP_PROXY" ;
@@ -11880,6 +11880,10 @@ class HttpClient {
11880
11880
this . _maxRetries = 1 ;
11881
11881
this . _keepAlive = false ;
11882
11882
this . _disposed = false ;
11883
+ this . _httpGlobalAgentOptions = {
11884
+ keepAlive : false ,
11885
+ timeout : 30000
11886
+ } ;
11883
11887
this . userAgent = userAgent ;
11884
11888
this . handlers = handlers || [ ] ;
11885
11889
let no_proxy = process . env [ EnvironmentVariables . NO_PROXY ] ;
@@ -11902,6 +11906,9 @@ class HttpClient {
11902
11906
this . _httpProxyBypassHosts . push ( new RegExp ( bypass , 'i' ) ) ;
11903
11907
} ) ;
11904
11908
}
11909
+ if ( requestOptions . globalAgentOptions ) {
11910
+ this . _httpGlobalAgentOptions = requestOptions . globalAgentOptions ;
11911
+ }
11905
11912
this . _certConfig = requestOptions . cert ;
11906
11913
if ( this . _certConfig ) {
11907
11914
// If using cert, need fs
@@ -12212,7 +12219,11 @@ class HttpClient {
12212
12219
}
12213
12220
// if not using private agent and tunnel agent isn't setup then use global agent
12214
12221
if ( ! agent ) {
12215
- agent = usingSsl ? https . globalAgent : http . globalAgent ;
12222
+ const globalAgentOptions = {
12223
+ keepAlive : this . _httpGlobalAgentOptions . keepAlive ,
12224
+ timeout : this . _httpGlobalAgentOptions . timeout
12225
+ } ;
12226
+ agent = usingSsl ? new https . Agent ( globalAgentOptions ) : new http . Agent ( globalAgentOptions ) ;
12216
12227
}
12217
12228
if ( usingSsl && this . _ignoreSslError ) {
12218
12229
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
@@ -12525,7 +12536,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12525
12536
} ) ;
12526
12537
} ;
12527
12538
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
12528
- exports . obtainContentCharset = exports . buildProxyBypassRegexFromEnv = exports . decompressGzippedContent = exports . getUrl = void 0 ;
12539
+ exports . getUrl = getUrl ;
12540
+ exports . decompressGzippedContent = decompressGzippedContent ;
12541
+ exports . buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv ;
12542
+ exports . obtainContentCharset = obtainContentCharset ;
12529
12543
const qs = __nccwpck_require__ ( 2760 ) ;
12530
12544
const url = __nccwpck_require__ ( 7310 ) ;
12531
12545
const path = __nccwpck_require__ ( 1017 ) ;
@@ -12563,7 +12577,6 @@ function getUrl(resource, baseUrl, queryParams) {
12563
12577
getUrlWithParsedQueryParams ( requestUrl , queryParams ) :
12564
12578
requestUrl ;
12565
12579
}
12566
- exports . getUrl = getUrl ;
12567
12580
/**
12568
12581
*
12569
12582
* @param {string } requestUrl
@@ -12613,7 +12626,6 @@ function decompressGzippedContent(buffer, charset) {
12613
12626
} ) ) ;
12614
12627
} ) ;
12615
12628
}
12616
- exports . decompressGzippedContent = decompressGzippedContent ;
12617
12629
/**
12618
12630
* Builds a RegExp to test urls against for deciding
12619
12631
* wether to bypass proxy from an entry of the
@@ -12635,7 +12647,6 @@ function buildProxyBypassRegexFromEnv(bypass) {
12635
12647
throw err ;
12636
12648
}
12637
12649
}
12638
- exports . buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv ;
12639
12650
/**
12640
12651
* Obtain Response's Content Charset.
12641
12652
* Through inspecting `content-type` response header.
@@ -12659,7 +12670,6 @@ function obtainContentCharset(response) {
12659
12670
}
12660
12671
return 'utf-8' ;
12661
12672
}
12662
- exports . obtainContentCharset = obtainContentCharset ;
12663
12673
12664
12674
12665
12675
/***/ } ) ,
0 commit comments