@whatwg-node/node-fetch
Advanced tools
Comparing version 0.5.20-rc-20240730143614-76ddb4acc63b332024d20ffa18898cf86b707623 to 0.5.20-rc-20240730145649-3d326c64a43b48290c8c30454172053ce6c74732
@@ -78,6 +78,12 @@ "use strict"; | ||
} | ||
if (requestInit?.agent != null && | ||
requestInit?.agent !== http_1.globalAgent && | ||
requestInit?.agent !== https_1.globalAgent) { | ||
this._agent = requestInit?.agent; | ||
if (requestInit?.agent != null) { | ||
if (requestInit?.agent === false) { | ||
this._agent = false; | ||
} | ||
if (this.url.startsWith('http:/') && this._agent instanceof http_1.Agent) { | ||
this._agent = requestInit?.agent; | ||
} | ||
else if (this.url.startsWith('https:/') && this._agent instanceof https_1.Agent) { | ||
this._agent = requestInit?.agent; | ||
} | ||
} | ||
@@ -84,0 +90,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { globalAgent as httpGlobalAgent } from 'http'; | ||
import { globalAgent as httpsGlobalAgent } from 'https'; | ||
import { Agent as HTTPAgent, globalAgent as httpGlobalAgent } from 'http'; | ||
import { Agent as HTTPSAgent, globalAgent as httpsGlobalAgent } from 'https'; | ||
import { PonyfillBody } from './Body.js'; | ||
@@ -75,6 +75,12 @@ import { isHeadersLike, PonyfillHeaders } from './Headers.js'; | ||
} | ||
if (requestInit?.agent != null && | ||
requestInit?.agent !== httpGlobalAgent && | ||
requestInit?.agent !== httpsGlobalAgent) { | ||
this._agent = requestInit?.agent; | ||
if (requestInit?.agent != null) { | ||
if (requestInit?.agent === false) { | ||
this._agent = false; | ||
} | ||
if (this.url.startsWith('http:/') && this._agent instanceof HTTPAgent) { | ||
this._agent = requestInit?.agent; | ||
} | ||
else if (this.url.startsWith('https:/') && this._agent instanceof HTTPSAgent) { | ||
this._agent = requestInit?.agent; | ||
} | ||
} | ||
@@ -81,0 +87,0 @@ } |
{ | ||
"name": "@whatwg-node/node-fetch", | ||
"version": "0.5.20-rc-20240730143614-76ddb4acc63b332024d20ffa18898cf86b707623", | ||
"version": "0.5.20-rc-20240730145649-3d326c64a43b48290c8c30454172053ce6c74732", | ||
"description": "Fetch API implementation for Node", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
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
199121
5143