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 {