Skip to content

Commit

Permalink
fix: headers
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Dec 13, 2023
1 parent f417e13 commit 935312e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/cli/lib/client.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions templates/deno/src/client.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions templates/node/lib/client.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/Node18Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests;

class Node16Test extends Base
class Node18Test extends Base
{
protected string $sdkName = 'node.js';
protected string $sdkPlatform = 'server';
Expand All @@ -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,
Expand Down

0 comments on commit 935312e

Please sign in to comment.