Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

make-fetch-happen

Package Overview
Dependencies
Maintainers
9
Versions
109
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 7.0.0 to 7.1.0

16

agent.js
'use strict'
const LRU = require('lru-cache')
const url = require('url')
const isLambda = require('is-lambda')

@@ -47,2 +48,11 @@ const AGENT_CACHE = new LRU({ max: 50 })

// keep alive in AWS lambda makes no sense
const lambdaAgent = !isLambda ? null
: isHttps ? require('https').globalAgent
: require('http').globalAgent
if (isLambda && !pxuri) {
return lambdaAgent
}
if (AGENT_CACHE.peek(key)) {

@@ -53,3 +63,7 @@ return AGENT_CACHE.get(key)

if (pxuri) {
const proxy = getProxy(pxuri, opts, isHttps)
const pxopts = isLambda ? {
...opts,
agent: lambdaAgent
} : opts
const proxy = getProxy(pxuri, pxopts, isHttps)
AGENT_CACHE.set(key, proxy)

@@ -56,0 +70,0 @@ return proxy

@@ -5,2 +5,9 @@ # Changelog

## [7.1.0](https://github.com/npm/make-fetch-happen/compare/v7.0.0...v7.1.0) (2019-12-17)
### Features
* use globalAgent when in lambda ([bd9409d](https://github.com/npm/make-fetch-happen/commit/bd9409da246a979b665ebd23967ec01dd928ce47)), closes [#4](https://github.com/npm/make-fetch-happen/issues/4)
## [7.0.0](https://github.com/npm/make-fetch-happen/compare/v6.1.0...v7.0.0) (2019-12-17)

@@ -7,0 +14,0 @@

3

package.json
{
"name": "make-fetch-happen",
"version": "7.0.0",
"version": "7.1.0",
"description": "Opinionated, caching, retrying fetch client",

@@ -41,2 +41,3 @@ "main": "index.js",

"https-proxy-agent": "^4.0.0",
"is-lambda": "^1.0.1",
"lru-cache": "^5.1.1",

@@ -43,0 +44,0 @@ "minipass": "^3.0.0",

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