Comparing version 5.3.2 to 5.4.0
'use strict'; | ||
var EventEmitter = require('events').EventEmitter; | ||
@@ -22,2 +23,3 @@ var http = require('http'); | ||
var parseJson = require('parse-json'); | ||
var isRetryAllowed = require('is-retry-allowed'); | ||
@@ -275,4 +277,4 @@ function requestAsEventEmitter(opts) { | ||
var retries = opts.retries; | ||
opts.retries = function backoff(iter) { | ||
if (iter > retries) { | ||
opts.retries = function backoff(iter, err) { | ||
if (iter > retries || !isRetryAllowed(err)) { | ||
return 0; | ||
@@ -279,0 +281,0 @@ } |
{ | ||
"name": "got", | ||
"version": "5.3.2", | ||
"version": "5.4.0", | ||
"description": "Simplified HTTP/HTTPS requests", | ||
@@ -52,2 +52,3 @@ "license": "MIT", | ||
"is-redirect": "^1.0.0", | ||
"is-retry-allowed": "^1.0.0", | ||
"is-stream": "^1.0.0", | ||
@@ -54,0 +55,0 @@ "lowercase-keys": "^1.0.0", |
@@ -126,2 +126,4 @@ <h1 align="center"> | ||
**Note:** `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module). | ||
Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry). | ||
@@ -128,0 +130,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
20165
298
300
16
+ Addedis-retry-allowed@^1.0.0
+ Addedis-retry-allowed@1.2.0(transitive)