Comparing version 3.4.3 to 3.4.4
@@ -7,2 +7,6 @@ import retry from "async-retry"; | ||
retry?: retry.Options; | ||
/** | ||
* If true, the engine will retry the request if the server returns a status code between 500 and 599 | ||
*/ | ||
retryOnServerError?: boolean; | ||
headers?: Record<string, string>; | ||
@@ -64,2 +68,3 @@ /** | ||
protected appendToURL(url: string): string; | ||
protected retryOnServerError(error: Error): boolean | undefined; | ||
} |
@@ -5,4 +5,6 @@ import retry from "async-retry"; | ||
import HttpError from "./errors/http-error.js"; | ||
import StatusCodeError from "./errors/status-code-error.js"; | ||
export const MIN_LENGTH_FOR_MORE_INFO_REQUEST = 1024 * 1024 * 3; // 3MB | ||
const DEFAULT_OPTIONS = { | ||
retryOnServerError: true, | ||
retry: { | ||
@@ -66,3 +68,3 @@ retries: 150, | ||
catch (error) { | ||
if (error instanceof HttpError) { | ||
if (error instanceof HttpError && !this.retryOnServerError(error)) { | ||
throwErr = error; | ||
@@ -92,3 +94,3 @@ return null; | ||
return; | ||
if (error instanceof HttpError) { | ||
if (error instanceof HttpError && !this.retryOnServerError(error)) { | ||
throw error; | ||
@@ -118,3 +120,6 @@ } | ||
} | ||
retryOnServerError(error) { | ||
return this.options.retryOnServerError && error instanceof StatusCodeError && error.statusCode >= 500; | ||
} | ||
} | ||
//# sourceMappingURL=base-download-engine-fetch-stream.js.map |
{ | ||
"name": "ipull", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"description": "The only file downloader you'll ever need. For node.js and the browser, CLI and library for fast and reliable file downloads.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
261158
3466