braid-http 0.3.5 → 0.3.7

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.
@@ -168,7 +168,7 @@ async function braid_fetch (url, params = {}) {
168
168
  if (params.subscribe)
169
169
  params.headers.set('subscribe', 'true')
170
170
  if (params.peer)
171
- params.header.set('peer', params.peer)
171
+ params.headers.set('peer', params.peer)
172
172
 
173
173
  // Prevent browsers from going to disk cache
174
174
  params.cache = 'no-cache'
@@ -332,6 +332,10 @@ function send_update(res, data, url, peer) {
332
332
  for (var [header, value] of Object.entries(data)) {
333
333
  header = header.toLowerCase()
334
334
 
335
+ // A header set to undefined acts like it wasn't set
336
+ if (value === undefined)
337
+ continue
338
+
335
339
  // Version and Parents get output in the Structured Headers format,
336
340
  // so we convert `value` from array to comma-separated strings.
337
341
  if (header === 'version') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"