braid-text 0.5.17 → 0.5.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.5.17",
3
+ "version": "0.5.19",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braid-text",
package/server.js CHANGED
@@ -311,7 +311,7 @@ function create_braid_text() {
311
311
  }
312
312
  },
313
313
  on_error: e => {
314
- options.on_disconnect?.()
314
+ options.on_disconnect?.(e)
315
315
  handle_error(e)
316
316
  }
317
317
  })
@@ -329,7 +329,7 @@ function create_braid_text() {
329
329
  braid_text.serve = async (req, res, options = {}) => {
330
330
  options = {
331
331
  key: req.url.split('?')[0],
332
- content_type: 'text/plain',
332
+ content_type: res.getHeader('Content-Type') || 'text/plain',
333
333
  put_cb: (key, val, params) => { },
334
334
  ...options
335
335
  }