braid-http 1.0.1 → 1.0.2

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.
@@ -234,8 +234,10 @@ async function braid_fetch (url, params = {}) {
234
234
 
235
235
  // If parents is a function,
236
236
  // call it now to get the latest parents
237
- if (typeof params.parents === 'function')
238
- params.headers.set('parents', params.parents().map(JSON.stringify).join(', '))
237
+ if (typeof params.parents === 'function') {
238
+ let parents = params.parents()
239
+ if (parents) params.headers.set('parents', parents.map(JSON.stringify).join(', '))
240
+ }
239
241
 
240
242
  // undocumented feature used by braid-chrome
241
243
  // to see the fetch args as they are right before it is actually called,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"