make-fetch-happen
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="2.6.0"></a> | ||
# [2.6.0](https://github.com/zkat/make-fetch-happen/compare/v2.5.0...v2.6.0) (2017-11-14) | ||
### Bug Fixes | ||
* **integrity:** disable node-fetch compress when checking integrity (#42) ([a7cc74c](https://github.com/zkat/make-fetch-happen/commit/a7cc74c)) | ||
### Features | ||
* **onretry:** Add `options.onRetry` (#48) ([f90ccff](https://github.com/zkat/make-fetch-happen/commit/f90ccff)) | ||
<a name="2.5.0"></a> | ||
@@ -7,0 +22,0 @@ # [2.5.0](https://github.com/zkat/make-fetch-happen/compare/v2.4.13...v2.5.0) (2017-08-24) |
14
index.js
@@ -111,2 +111,4 @@ 'use strict' | ||
initializeSsri() | ||
// if verifying integrity, node-fetch must not decompress | ||
opts.compress = false | ||
} | ||
@@ -357,2 +359,6 @@ | ||
if (res.status >= 500 && req.method !== 'POST' && !isStream) { | ||
if (typeof opts.onRetry === 'function') { | ||
opts.onRetry(res) | ||
} | ||
return retryHandler(res) | ||
@@ -375,2 +381,6 @@ } | ||
if (isRetriable) { | ||
if (typeof opts.onRetry === 'function') { | ||
opts.onRetry(res) | ||
} | ||
return retryHandler(res) | ||
@@ -443,2 +453,6 @@ } | ||
if (typeof opts.onRetry === 'function') { | ||
opts.onRetry(err) | ||
} | ||
return retryHandler(err) | ||
@@ -445,0 +459,0 @@ }) |
{ | ||
"name": "make-fetch-happen", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Opinionated, caching, retrying fetch client", | ||
@@ -37,12 +37,12 @@ "main": "index.js", | ||
"agentkeepalive": "^3.3.0", | ||
"cacache": "^9.2.9", | ||
"http-cache-semantics": "^3.7.3", | ||
"cacache": "^10.0.0", | ||
"http-cache-semantics": "^3.8.0", | ||
"http-proxy-agent": "^2.0.0", | ||
"https-proxy-agent": "^2.0.0", | ||
"https-proxy-agent": "^2.1.0", | ||
"lru-cache": "^4.1.1", | ||
"mississippi": "^1.2.0", | ||
"node-fetch-npm": "^2.0.1", | ||
"node-fetch-npm": "^2.0.2", | ||
"promise-retry": "^1.1.1", | ||
"socks-proxy-agent": "^3.0.0", | ||
"ssri": "^4.1.6" | ||
"socks-proxy-agent": "^3.0.1", | ||
"ssri": "^5.0.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
@@ -5,4 +5,4 @@ # make-fetch-happen [![npm version](https://img.shields.io/npm/v/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![license](https://img.shields.io/npm/l/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![Travis](https://img.shields.io/travis/zkat/make-fetch-happen.svg)](https://travis-ci.org/zkat/make-fetch-happen) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/make-fetch-happen?svg=true)](https://ci.appveyor.com/project/zkat/make-fetch-happen) [![Coverage Status](https://coveralls.io/repos/github/zkat/make-fetch-happen/badge.svg?branch=latest)](https://coveralls.io/github/zkat/make-fetch-happen?branch=latest) | ||
[`make-fetch-happen`](https://github.com/zkat/make-fetch-happen) is a Node.js | ||
library that wraps [`node-fetch`](https://npm.im/node-fetch) with additional | ||
features it doesn't intend to include, including HTTP Cache support, request | ||
library that wraps [`node-fetch-npm`](https://github.com/npm/node-fetch-npm) with additional | ||
features [`node-fetch`](https://github.com/bitinn/node-fetch) doesn't intend to include, including HTTP Cache support, request | ||
pooling, proxies, retries, [and more](#features)! | ||
@@ -31,2 +31,3 @@ | ||
* [`opts.retry`](#opts-retry) | ||
* [`opts.onRetry`](#opts-onretry) | ||
* [`opts.integrity`](#opts-integrity) | ||
@@ -148,2 +149,3 @@ * [Message From Our Sponsors](#wow) | ||
* [`opts.retry`](#opts-retry) - Request retry settings | ||
* [`opts.onRetry`](#opts-onretry) - a function called whenever a retry is attempted | ||
* [`opts.integrity`](#opts-integrity) - [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) metadata. | ||
@@ -369,2 +371,16 @@ | ||
#### <a name="opts-onretry"></a> `> opts.onRetry` | ||
A function called whenever a retry is attempted. | ||
##### Example | ||
```javascript | ||
fetch('https://flaky.site.com', { | ||
onRetry() { | ||
console.log('we will retry!') | ||
} | ||
}) | ||
``` | ||
#### <a name="opts-integrity"></a> `> opts.integrity` | ||
@@ -383,3 +399,3 @@ | ||
fetch('https://malicious-registry.org/make-fetch-happen/-/make-fetch-happen-1.0.0.tgz'. { | ||
fetch('https://malicious-registry.org/make-fetch-happen/-/make-fetch-happen-1.0.0.tgz', { | ||
integrity: 'sha1-o47j7zAYnedYFn1dF/fR9OV3z8Q=' | ||
@@ -386,0 +402,0 @@ }) // Error: EINTEGRITY |
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
63263
816
405
+ Addedcacache@10.0.4(transitive)
+ Addedmississippi@2.0.0(transitive)
+ Addedssri@5.3.0(transitive)
+ Addedy18n@4.0.3(transitive)
- Removedcacache@9.3.0(transitive)
- Removedssri@4.1.6(transitive)
- Removedy18n@3.2.2(transitive)
Updatedcacache@^10.0.0
Updatedhttp-cache-semantics@^3.8.0
Updatedhttps-proxy-agent@^2.1.0
Updatednode-fetch-npm@^2.0.2
Updatedsocks-proxy-agent@^3.0.1
Updatedssri@^5.0.0