braid-text 0.3.21 → 0.3.22
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/client/simpleton-sync.js +5 -2
- package/package.json +1 -1
package/client/simpleton-sync.js
CHANGED
|
@@ -104,7 +104,8 @@ function simpleton_client(url, {
|
|
|
104
104
|
get_patches,
|
|
105
105
|
get_state,
|
|
106
106
|
content_type,
|
|
107
|
-
|
|
107
|
+
headers: user_headers, // The user can pass in custom headers
|
|
108
|
+
// that are forwared into the fetch
|
|
108
109
|
on_error,
|
|
109
110
|
on_res,
|
|
110
111
|
on_online,
|
|
@@ -141,7 +142,8 @@ function simpleton_client(url, {
|
|
|
141
142
|
retry: () => true,
|
|
142
143
|
parents: () => client_version.length ? client_version : null,
|
|
143
144
|
onSubscriptionStatus: status => on_online && on_online(status.online),
|
|
144
|
-
headers: {
|
|
145
|
+
headers: { ...user_headers,
|
|
146
|
+
"Merge-Type": "simpleton",
|
|
145
147
|
...content_type && {Accept: content_type} },
|
|
146
148
|
}).then(res => {
|
|
147
149
|
if (on_res) on_res(res)
|
|
@@ -328,6 +330,7 @@ function simpleton_client(url, {
|
|
|
328
330
|
peer, version, parents, patches,
|
|
329
331
|
retry: (res) => res.status !== 550,
|
|
330
332
|
headers: {
|
|
333
|
+
...user_headers,
|
|
331
334
|
"Merge-Type": "simpleton",
|
|
332
335
|
...send_digests && {
|
|
333
336
|
"Repr-Digest": await get_digest(client_state) },
|