braid-text 0.2.32 → 0.2.33

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.
package/index.js CHANGED
@@ -180,7 +180,10 @@ braid_text.serve = async (req, res, options = {}) => {
180
180
  // we want to send some kind of error that gives the client faith,
181
181
  // that resending this request later may work,
182
182
  // hopefully after we've received the necessary parents.
183
- return done_my_turn(309, e.message, 'Missing Parents', { 'Retry-After': '1' })
183
+ return done_my_turn(309, e.message, 'Version Unknown', {
184
+ Parents: req.headers.parents,
185
+ 'Retry-After': '1'
186
+ })
184
187
  } else {
185
188
  return done_my_turn(500, "The server failed to apply this version. The error generated was: " + e)
186
189
  }
@@ -1863,6 +1866,10 @@ class RangeSet {
1863
1866
  }
1864
1867
  }
1865
1868
 
1869
+ function ascii_ify(s) {
1870
+ return s.replace(/[^\x20-\x7E]/g, c => '\\u' + c.charCodeAt(0).toString(16).padStart(4, '0'))
1871
+ }
1872
+
1866
1873
  braid_text.get_resource = get_resource
1867
1874
 
1868
1875
  braid_text.encode_filename = encode_filename
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
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/test/test.html CHANGED
@@ -68,12 +68,12 @@ runTest(
68
68
  let r = await braid_fetch(`/${key}`, {
69
69
  method: 'PUT',
70
70
  version: ['hi-1'],
71
- parents: ['missing-0'],
71
+ parents: ['missing-0', 'y😀-0'],
72
72
  body: 'xx'
73
73
  })
74
- return r.status + ' ' + r.ok
74
+ return r.status + ' ' + r.ok + ' ' + r.statusText + ' ' + r.headers.get('Parents')
75
75
  },
76
- '309 false'
76
+ '309 false Version Unknown "missing-0", "y\\ud83d\\ude00-0"'
77
77
  )
78
78
 
79
79
  runTest(