File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,9 +78,16 @@ export default abstract class BaseRestClient {
7878
7979 // If enabled, configure a https agent with keepAlive enabled
8080 if ( this . options . keepAlive ) {
81+ // Extract existing https agent parameters, if provided, to prevent the keepAlive flag from overwriting an existing https agent completely
82+ const existingHttpsAgent = this . globalRequestOptions . httpsAgent as
83+ | https . Agent
84+ | undefined ;
85+ const existingAgentOptions = existingHttpsAgent ?. options || { } ;
86+
8187 // For more advanced configuration, raise an issue on GitHub or use the "networkOptions"
8288 // parameter to define a custom httpsAgent with the desired properties
8389 this . globalRequestOptions . httpsAgent = new https . Agent ( {
90+ ...existingAgentOptions ,
8491 keepAlive : true ,
8592 keepAliveMsecs : this . options . keepAliveMsecs ,
8693 } ) ;
You can’t perform that action at this time.
0 commit comments