diff --git a/src/ApiClient.ts b/src/ApiClient.ts index f56ae4d34..4766f7388 100644 --- a/src/ApiClient.ts +++ b/src/ApiClient.ts @@ -109,7 +109,7 @@ export default class ApiClient { { pathPrefix: this.pathPrefix, mode: 'cors', - headers: { Authorization: `Bearer ${authToken}` }, + headers: new Headers({ Authorization: `Bearer ${authToken}` }), }, ], this.maxRetries, diff --git a/test/ApiClient.test.ts b/test/ApiClient.test.ts index 82984b8b7..ab3238aa1 100644 --- a/test/ApiClient.test.ts +++ b/test/ApiClient.test.ts @@ -154,9 +154,7 @@ describe('Publish', () => { expect(publishMock).toHaveBeenCalledWith(expectedRequest, { pathPrefix: PATH_PREFIX, mode: 'cors', - headers: { - Authorization: `Bearer ${AUTH_TOKEN}`, - }, + headers: new Headers({ Authorization: `Bearer ${AUTH_TOKEN}` }), }) })