From dafeca247eee7151a8abe913f63879777042bfd6 Mon Sep 17 00:00:00 2001 From: Bart Tadych Date: Fri, 14 Apr 2023 17:18:21 +0200 Subject: [PATCH] fix: fixed adding the SDK version to HTTP headers. (#1096) --- .changeset/green-pans-brush.md | 5 +++++ .../src/resolvers2/getSdkDetailsHeaders.test.ts | 11 +++++++++++ .../apiUtils/src/resolvers2/getSdkDetailsHeaders.ts | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .changeset/green-pans-brush.md create mode 100644 packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.test.ts diff --git a/.changeset/green-pans-brush.md b/.changeset/green-pans-brush.md new file mode 100644 index 0000000000..2d91b0c452 --- /dev/null +++ b/.changeset/green-pans-brush.md @@ -0,0 +1,5 @@ +--- +'@moralisweb3/api-utils': patch +--- + +Fixed adding the SDK version to HTTP headers. diff --git a/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.test.ts b/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.test.ts new file mode 100644 index 0000000000..ed549d5dd6 --- /dev/null +++ b/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.test.ts @@ -0,0 +1,11 @@ +import { getSdkDetailsHeaders } from './getSdkDetailsHeaders'; + +describe('getSdkDetailsHeaders', () => { + it('returns proper values', () => { + const headers = getSdkDetailsHeaders(); + + expect(headers['x-moralis-platform']).toBeDefined(); + expect(headers['x-moralis-platform-version']).toBeDefined(); + expect(headers['x-moralis-build-target']).toBeDefined(); + }); +}); diff --git a/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.ts b/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.ts index 946c85f58d..70bc53b7ec 100644 --- a/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.ts +++ b/packages/apiUtils/src/resolvers2/getSdkDetailsHeaders.ts @@ -1,4 +1,4 @@ -import Core from '@moralisweb3/common-core'; +import { Core } from '@moralisweb3/common-core'; export type Headers = { [key: string]: string }; enum Environment {