Skip to content

Commit

Permalink
Rename custom metric header (#225)
Browse files Browse the repository at this point in the history
* rename custom metric header

* rename header
0xmaayan authored Dec 7, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b227e41 commit 36f38ff
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ All notable changes to the Aptos TypeScript SDK will be captured in this file. T
# Unreleased

- Add release automation, so version updates can be made with simply `pnpm update-version`
- Rename custom request header to `aptos-typescript-sdk`

## 0.0.8 (2023-11-29)

2 changes: 1 addition & 1 deletion src/client/core.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export async function request<Req, Res>(options: ClientRequest<Req>, client: Cli
const { url, method, body, contentType, params, overrides } = options;
const headers: Record<string, string | AnyNumber | boolean | undefined> = {
...overrides?.HEADERS,
"x-aptos-client": `aptos-ts-sdk/${VERSION}`,
"x-aptos-client": `aptos-typescript-sdk/${VERSION}`,
"content-type": contentType ?? MimeType.JSON,
};

2 changes: 1 addition & 1 deletion tests/e2e/client/aptosRequest.test.ts
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ describe("aptos request", () => {
},
config,
);
expect(response.config.headers).toHaveProperty("x-aptos-client", `aptos-ts-sdk/${VERSION}`);
expect(response.config.headers).toHaveProperty("x-aptos-client", `aptos-typescript-sdk/${VERSION}`);
expect(response.config.headers).toHaveProperty("my", "header");
expect(response.config.headers).toHaveProperty("content-type", "application/x.aptos.signed_transaction+bcs");
} catch (error: any) {

0 comments on commit 36f38ff

Please sign in to comment.