diff --git a/index.d.ts b/index.d.ts index 464ef2b6..eb4ca7fc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -55,6 +55,7 @@ export interface Config { live_preview?: LivePreview; plugins?: ContentstackPlugin[]; fetchOptions?: FetchOptions; + ea_headers?: string[] } // Stack Config export interface StackConfig { diff --git a/src/core/stack.js b/src/core/stack.js index 89076bd6..d25e2bf2 100755 --- a/src/core/stack.js +++ b/src/core/stack.js @@ -101,6 +101,9 @@ export default class Stack { if (typeof stack_arguments[0].branch === "string" && stack_arguments[0].branch !== undefined) { this.headers.branch = stack_arguments[0].branch } + if (typeof stack_arguments[0].ea_headers == "object" && Array.isArray(stack_arguments[0].ea_headers) && stack_arguments[0].ea_headers.length > 0) { + this.headers['x-header-ea'] = stack_arguments[0].ea_headers.join(',') + } this.environment = stack_arguments[0].environment; return this; } else {