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.
@@ -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.retryRes) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.76",
3
+ "version": "1.3.77",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"