@@ -11783,7 +11783,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1178311783 } ) ;
1178411784} ;
1178511785Object . 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 ;
1178711788const url = __nccwpck_require__ ( 7310 ) ;
1178811789const http = __nccwpck_require__ ( 3685 ) ;
1178911790const https = __nccwpck_require__ ( 5687 ) ;
@@ -11863,7 +11864,6 @@ function isHttps(requestUrl) {
1186311864 let parsedUrl = url . parse ( requestUrl ) ;
1186411865 return parsedUrl . protocol === 'https:' ;
1186511866}
11866- exports . isHttps = isHttps ;
1186711867var EnvironmentVariables ;
1186811868( function ( EnvironmentVariables ) {
1186911869 EnvironmentVariables [ "HTTP_PROXY" ] = "HTTP_PROXY" ;
@@ -11880,6 +11880,10 @@ class HttpClient {
1188011880 this . _maxRetries = 1 ;
1188111881 this . _keepAlive = false ;
1188211882 this . _disposed = false ;
11883+ this . _httpGlobalAgentOptions = {
11884+ keepAlive : false ,
11885+ timeout : 30000
11886+ } ;
1188311887 this . userAgent = userAgent ;
1188411888 this . handlers = handlers || [ ] ;
1188511889 let no_proxy = process . env [ EnvironmentVariables . NO_PROXY ] ;
@@ -11902,6 +11906,9 @@ class HttpClient {
1190211906 this . _httpProxyBypassHosts . push ( new RegExp ( bypass , 'i' ) ) ;
1190311907 } ) ;
1190411908 }
11909+ if ( requestOptions . globalAgentOptions ) {
11910+ this . _httpGlobalAgentOptions = requestOptions . globalAgentOptions ;
11911+ }
1190511912 this . _certConfig = requestOptions . cert ;
1190611913 if ( this . _certConfig ) {
1190711914 // If using cert, need fs
@@ -12212,7 +12219,11 @@ class HttpClient {
1221212219 }
1221312220 // if not using private agent and tunnel agent isn't setup then use global agent
1221412221 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 ) ;
1221612227 }
1221712228 if ( usingSsl && this . _ignoreSslError ) {
1221812229 // 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
1252512536 } ) ;
1252612537} ;
1252712538Object . 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 ;
1252912543const qs = __nccwpck_require__ ( 2760 ) ;
1253012544const url = __nccwpck_require__ ( 7310 ) ;
1253112545const path = __nccwpck_require__ ( 1017 ) ;
@@ -12563,7 +12577,6 @@ function getUrl(resource, baseUrl, queryParams) {
1256312577 getUrlWithParsedQueryParams ( requestUrl , queryParams ) :
1256412578 requestUrl ;
1256512579}
12566- exports . getUrl = getUrl ;
1256712580/**
1256812581 *
1256912582 * @param {string } requestUrl
@@ -12613,7 +12626,6 @@ function decompressGzippedContent(buffer, charset) {
1261312626 } ) ) ;
1261412627 } ) ;
1261512628}
12616- exports . decompressGzippedContent = decompressGzippedContent ;
1261712629/**
1261812630 * Builds a RegExp to test urls against for deciding
1261912631 * wether to bypass proxy from an entry of the
@@ -12635,7 +12647,6 @@ function buildProxyBypassRegexFromEnv(bypass) {
1263512647 throw err ;
1263612648 }
1263712649}
12638- exports . buildProxyBypassRegexFromEnv = buildProxyBypassRegexFromEnv ;
1263912650/**
1264012651 * Obtain Response's Content Charset.
1264112652 * Through inspecting `content-type` response header.
@@ -12659,7 +12670,6 @@ function obtainContentCharset(response) {
1265912670 }
1266012671 return 'utf-8' ;
1266112672}
12662- exports . obtainContentCharset = obtainContentCharset ;
1266312673
1266412674
1266512675/***/ } ) ,
0 commit comments