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 +8 -1
- package/package.json +1 -1
- package/test/test.html +3 -3
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, '
|
|
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
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(
|