diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index dc29ae34c..24b96b0e1 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -91,6 +91,7 @@ class Client { } async call(method, path = "", headers = {}, params = {}) { + headers = {...this.headers, ...headers}; const url = new URL(path, this.endpoint); let body = undefined; diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 862e23027..087a56a26 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -62,6 +62,7 @@ export class Client { } async call(method: string, path: string = "", headers: Payload = {}, params: Payload = {}) { + headers = {...this.headers, ...headers}; const url = new URL(path, this.endpoint); let body: string | FormData | undefined = undefined; diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 0fe0b7cb3..363518962 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -84,6 +84,7 @@ class Client { } async call(method, path = "", headers = {}, params = {}) { + headers = {...this.headers, ...headers}; const url = new URL(path, this.endpoint); let body = undefined; diff --git a/tests/Node18Test.php b/tests/Node18Test.php index e507f1e5f..9df997ba5 100644 --- a/tests/Node18Test.php +++ b/tests/Node18Test.php @@ -2,7 +2,7 @@ namespace Tests; -class Node16Test extends Base +class Node18Test extends Base { protected string $sdkName = 'node.js'; protected string $sdkPlatform = 'server'; @@ -15,7 +15,7 @@ class Node16Test extends Base 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/node node:18-alpine npm install', ]; protected string $command = - 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app node:16-alpine node tests/languages/node/test.js'; + 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app node:18-alpine node tests/languages/node/test.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES,