diff --git a/src/common/lib/client/restannotations.ts b/src/common/lib/client/restannotations.ts index b6f0f99804..f7d3cd021c 100644 --- a/src/common/lib/client/restannotations.ts +++ b/src/common/lib/client/restannotations.ts @@ -78,6 +78,8 @@ class RestAnnotations { headers = Defaults.defaultPostHeaders(client.options, { format }), params = {}; + Utils.mixin(headers, client.options.headers); + const requestBody = Utils.encodeBody([wireAnnotation], client._MsgPack, format); await Resource.post( diff --git a/test/browser/modular.test.js b/test/browser/modular.test.js index e44f9a74e5..b949db16be 100644 --- a/test/browser/modular.test.js +++ b/test/browser/modular.test.js @@ -889,7 +889,10 @@ function registerAblyModularTests(Helper) { it('doesn’t break when it receives an ANNOTATION ProtocolMessage', async function () { const helper = this.test.helper; const rxClient = new BaseRealtime( - helper.ablyClientOptions({ plugins: { WebSocketTransport, FetchRequest } }), + helper.ablyClientOptions({ + clientId: Helper.randomString(10), + plugins: { WebSocketTransport, FetchRequest }, + }), ); const channelName = 'mutable:annotation-1'; @@ -902,6 +905,7 @@ function registerAblyModularTests(Helper) { const txClient = new BaseRealtime( this.test.helper.ablyClientOptions({ + clientId: Helper.randomString(10), plugins: { WebSocketTransport, FetchRequest, @@ -935,6 +939,7 @@ function registerAblyModularTests(Helper) { const channelName = 'mutable:annotation-2'; const rxClient = new BaseRealtime( helper.ablyClientOptions({ + clientId: Helper.randomString(10), plugins: { WebSocketTransport, FetchRequest, @@ -949,6 +954,7 @@ function registerAblyModularTests(Helper) { await helper.monitorConnectionThenCloseAndFinishAsync(async () => { const txRealtime = new BaseRealtime( this.test.helper.ablyClientOptions({ + clientId: Helper.randomString(10), plugins: { WebSocketTransport, FetchRequest, @@ -958,6 +964,7 @@ function registerAblyModularTests(Helper) { ); const txRest = new BaseRest( this.test.helper.ablyClientOptions({ + clientId: Helper.randomString(10), plugins: { FetchRequest, Annotations, diff --git a/test/realtime/annotations.test.js b/test/realtime/annotations.test.js index 3c36bc1d02..2136afce5d 100644 --- a/test/realtime/annotations.test.js +++ b/test/realtime/annotations.test.js @@ -14,13 +14,13 @@ define(['shared_helper', 'chai'], function (Helper, chai) { done(err); return; } - rest = helper.AblyRest(); + rest = helper.AblyRest({ clientId: Helper.randomString(10) }); done(); }); }); beforeEach(async () => { - realtime = helper.AblyRealtime(); + realtime = helper.AblyRealtime({ clientId: Helper.randomString(10) }); }); afterEach(async () => {