@@ -2,14 +2,12 @@ import { readFile } from 'node:fs/promises';
22import http from 'node:http' ;
33import https from 'node:https' ;
44import * as jks from 'jks-js' ;
5- // @ts -expect-error - ts fails to detect that this package provides CJS exports
6- import * as ohash from 'ohash' ;
75import { createLogger , last } from '@sap-cloud-sdk/util' ;
86/* Careful the proxy imports cause circular dependencies if imported from scp directly */
97// eslint-disable-next-line import/no-internal-modules
108import { getProtocolOrDefault } from '../scp-cf/get-protocol' ;
119// eslint-disable-next-line import/no-internal-modules
12- import { Cache } from '../scp-cf/cache' ;
10+ import { Cache , hashCacheKey } from '../scp-cf/cache' ;
1311import {
1412 addProxyConfigurationInternet ,
1513 getProxyConfig ,
@@ -309,7 +307,8 @@ function createAgent(
309307 options : https . AgentOptions
310308) : HttpAgentConfig | HttpsAgentConfig {
311309 const protocol = getProtocolOrDefault ( destination ) ;
312- const cacheKey = ohash . hash ( { protocol, options } ) ;
310+ const cacheKey = hashCacheKey ( { protocol, options } ) ;
311+
313312 return agentCreateCache . getOrInsertComputed ( cacheKey , ( ) => {
314313 logger . debug (
315314 `Creating new ${ protocol . toUpperCase ( ) } agent for destination ${ destination . name || '<unknown>' } `
0 commit comments