braid-http 1.3.76 → 1.3.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/braid-http-client.js +4 -1
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -439,7 +439,10 @@ async function braid_fetch (url, params = {}) {
|
|
|
439
439
|
|
|
440
440
|
if (params.retry && !res.ok) {
|
|
441
441
|
var give_up
|
|
442
|
-
if (params.retry
|
|
442
|
+
if (typeof params.retry === 'function') {
|
|
443
|
+
give_up = !params.retry(res)
|
|
444
|
+
} else if (params.retry.retryRes) {
|
|
445
|
+
// deprecated in favor of setting retry to a function
|
|
443
446
|
give_up = !params.retry.retryRes(res)
|
|
444
447
|
} else {
|
|
445
448
|
give_up = res.status >= 400 && res.status < 600
|