@adobe/fetch
Advanced tools
Comparing version 4.1.5 to 4.1.6
{ | ||
"name": "@adobe/fetch", | ||
"version": "4.1.5", | ||
"version": "4.1.6", | ||
"description": "Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -39,3 +39,16 @@ /* | ||
// use default (global) agent | ||
return undefined; | ||
/* c8 ignore next 13 */ | ||
/* => code coverage depends on the node version */ | ||
if (https.globalAgent.keepAlive) /* node >= 19 */ { | ||
// As of Node.js v19 the global agent has keep-alive enabled by default: | ||
// https://nodejs.org/api/http.html#class-httpagent | ||
// https://github.com/nodejs/node/issues/37184 | ||
// https://github.com/nodejs/node/pull/43522/files#diff-494d2deee304c672124ecd82d090283595fd3d8c5a80a1825d972a2d229e4944L334-R334 | ||
// In order to guarantee consistent behavior across node versions we | ||
// always create a new agent with keep-alive enabled on Node.js v19+. | ||
h1.httpsAgent = new https.Agent({ keepAlive: false }); | ||
return h1.httpsAgent; | ||
} else /* node <= 18 */ { | ||
return undefined; | ||
} | ||
} else { | ||
@@ -51,3 +64,16 @@ // plain http | ||
// use default (global) agent | ||
return undefined; | ||
/* c8 ignore next 13 */ | ||
/* => code coverage depends on the node version */ | ||
if (http.globalAgent.keepAlive) /* node >= 19 */ { | ||
// As of Node.js v19 the global agent has keep-alive enabled by default: | ||
// https://nodejs.org/api/http.html#class-httpagent | ||
// https://github.com/nodejs/node/issues/37184 | ||
// https://github.com/nodejs/node/pull/43522/files#diff-494d2deee304c672124ecd82d090283595fd3d8c5a80a1825d972a2d229e4944L334-R334 | ||
// In order to guarantee consistent behavior across node versions we | ||
// always create a new agent with keep-alive enabled on Node.js v19+. | ||
h1.httpAgent = new http.Agent({ keepAlive: false }); | ||
return h1.httpAgent; | ||
} else /* node <= 18 */ { | ||
return undefined; | ||
} | ||
} | ||
@@ -54,0 +80,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144644
3317