Socket
Socket
Sign inDemoInstall

make-fetch-happen

Package Overview
Dependencies
Maintainers
6
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-fetch-happen - npm Package Compare versions

Comparing version 9.0.0 to 9.0.1

37

lib/agent.js

@@ -7,4 +7,4 @@ 'use strict'

const AGENT_CACHE = new LRU({ max: 50 })
let HttpsAgent
let HttpAgent
const HttpAgent = require('agentkeepalive')
const HttpsAgent = HttpAgent.HttpsAgent

@@ -70,7 +70,2 @@ module.exports = getAgent

if (!HttpsAgent) {
HttpAgent = require('agentkeepalive')
HttpsAgent = HttpAgent.HttpsAgent
}
const agent = isHttps ? new HttpsAgent({

@@ -160,4 +155,4 @@ maxSockets: agentMaxSockets,

const getAuth = u =>
u.username && u.password ? `${u.username}:${u.password}`
: u.username ? u.username
u.username && u.password ? decodeURIComponent(`${u.username}:${u.password}`)
: u.username ? decodeURIComponent(u.username)
: null

@@ -167,5 +162,5 @@

let HttpProxyAgent
let HttpsProxyAgent
let SocksProxyAgent
const HttpProxyAgent = require('http-proxy-agent')
const HttpsProxyAgent = require('https-proxy-agent')
const SocksProxyAgent = require('socks-proxy-agent')
module.exports.getProxy = getProxy

@@ -189,19 +184,9 @@ function getProxy (proxyUrl, opts, isHttps) {

if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') {
if (!isHttps) {
if (!HttpProxyAgent)
HttpProxyAgent = require('http-proxy-agent')
if (!isHttps)
return new HttpProxyAgent(popts)
} else {
if (!HttpsProxyAgent)
HttpsProxyAgent = require('https-proxy-agent')
else
return new HttpsProxyAgent(popts)
}
} else if (proxyUrl.protocol.startsWith('socks')) {
if (!SocksProxyAgent)
SocksProxyAgent = require('socks-proxy-agent')
} else if (proxyUrl.protocol.startsWith('socks'))
return new SocksProxyAgent(popts)
} else {
else {
throw Object.assign(

@@ -208,0 +193,0 @@ new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`),

{
"name": "make-fetch-happen",
"version": "9.0.0",
"version": "9.0.1",
"description": "Opinionated, caching, retrying fetch client",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc