Skip to content

Commit 3d08243

Browse files
authored
Merge pull request #7 from envoy/gp/DEVP-432/add-envoy-context
gp/DEVP-432/add X-Envoy-Context in HTTP headers
2 parents 5bd1962 + aedb6aa commit 3d08243

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/EnvoyAPI.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class EnvoyAPI {
3939
/**
4040
* @param {string} token
4141
*/
42-
constructor(token) {
42+
constructor(token, xEnvoyContext = {}) {
4343

4444
if (!token) {
4545
throw new Error('No token supplied.');
@@ -51,6 +51,7 @@ class EnvoyAPI {
5151
Authorization: `Bearer ${token}`,
5252
'Content-Type': 'application/vnd.api+json',
5353
Accept: 'application/vnd.api+json',
54+
'X-Envoy-Context': JSON.stringify(xEnvoyContext),
5455
},
5556
json: true,
5657
baseUrl: this.baseUrl,

package-lock.json

Lines changed: 1 addition & 1 deletion
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": "@envoy/envoy-integrations-sdk",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)