braid-http 1.3.73 → 1.3.74

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.
@@ -443,9 +443,13 @@ async function braid_fetch (url, params = {}) {
443
443
  case 429: // Too Many Requests
444
444
 
445
445
  case 502: // Bad Gateway
446
+ case 503: // Service Unavailable
446
447
  case 504: // Gateway Timeout
447
448
  give_up = false
448
449
  }
450
+ if (res.statusText.match(/Missing Parents/i) ||
451
+ res.headers.get('retry-after') !== null)
452
+ give_up = false
449
453
  if (give_up) {
450
454
  if (subscription_cb) subscription_error?.(new Error(`giving up because of http status: ${res.status}${(res.status === 401 || res.status === 403) ? ` (access denied)` : ''}`))
451
455
  } else if (!res.ok) throw new Error(`status not ok: ${res.status}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.73",
3
+ "version": "1.3.74",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"