Skip to content

Commit af249a9

Browse files
authored
Use Abound-SDK header (#75)
* Use Abound-SDK header * Bump version
1 parent ba09760 commit af249a9

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@withabound/node-sdk",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "The Abound Node library provides convenient access to the Abound API from applications written in server-side JavaScript.",
55
"author": "Abound <[email protected]>",
66
"license": "MIT",

src/util/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export function initAxios(config: AboundConfig): AxiosInstance {
88
return axios.create({
99
baseURL: `${config.environment}${config.apiVersion}`,
1010
headers: {
11-
"Content-Type": "application/json",
11+
"Abound-SDK": `NodeSDK/${version}`,
1212
Authorization: `Bearer ${config.appId}.${config.appSecret}`,
13-
"User-Agent": `NodeSDK/${version}`,
13+
"Content-Type": "application/json",
1414
},
1515
});
1616
}

src/util/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Generated by genversion.
2-
export const version = "1.3.0";
2+
export const version = "1.3.1";

tests/util/http.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("http", () => {
4545
* User-Agent headers (https://github.com/nock/nock#enable_reqheaders_recording-option)
4646
*/
4747
describe("axios client", () => {
48-
it("injects a User-Agent header into each request with a value that includes the SDK's version", () => {
48+
it("injects a Abound-SDK header into each request with a value that includes the SDK's version", () => {
4949
const axios: AxiosInstance = buildAxiosInstance();
5050
const mockAxios = new MockAdapter(axios);
5151

@@ -62,8 +62,8 @@ describe("http", () => {
6262
const requestHeaders: Record<string, string> =
6363
mockAxios.history.get[0].headers;
6464

65-
const userAgent: string = requestHeaders["User-Agent"];
66-
expect(userAgent).toEqual(`NodeSDK/${version}`);
65+
const aboundSDK: string = requestHeaders["Abound-SDK"];
66+
expect(aboundSDK).toEqual(`NodeSDK/${version}`);
6767
});
6868
});
6969
});

0 commit comments

Comments
 (0)