From e6f6ea6899789b22ddd1dd588bf377570c32030b Mon Sep 17 00:00:00 2001 From: Conor McDermottroe Date: Wed, 27 Apr 2022 22:02:12 +0100 Subject: [PATCH] Add a User-Agent header This will make it more obvious to CircleCI as to where the API calls are being generated. It should make it easier to cooperate on any API changes in the future. --- src/client.test.ts | 1 + src/client.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/client.test.ts b/src/client.test.ts index b2f0aed..e1b1a82 100644 --- a/src/client.test.ts +++ b/src/client.test.ts @@ -46,6 +46,7 @@ function expectFetch( Object.assign( { 'Circle-Token': apiKey, + 'User-Agent': `jodyheavener/circle-client (v${pck.version})`, 'X-Circle-Client': `v${pck.version}`, }, [HTTPMethod.Post, HTTPMethod.Put].includes(method) && body diff --git a/src/client.ts b/src/client.ts index 9f0db10..efedb3a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -327,6 +327,7 @@ class CircleCI { this.headers = { ...headers, 'Circle-Token': this.apiKey, + 'User-Agent': `jodyheavener/circle-client (v${pck.version})`, 'X-Circle-Client': `v${pck.version}`, }; }