Skip to content

Commit d7329c6

Browse files
committed
Setting slash headers regardless of whether it login or not
1 parent e75fcc2 commit d7329c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/clientStub.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ var DgraphClientStub = (function () {
368368
switch (_a.label) {
369369
case 0:
370370
url = this.getURL(path);
371+
config.headers = config.headers !== undefined ? config.headers : {};
371372
if (this.accessToken !== undefined && path !== "login") {
372-
config.headers = config.headers !== undefined ? config.headers : {};
373373
config.headers[ACL_TOKEN_HEADER] = this.accessToken;
374374
}
375375
return [4, fetch(url, config)];

src/clientStub.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ export class DgraphClientStub {
420420

421421
private async callAPI<T>(path: string, config: Config): Promise<T> {
422422
const url = this.getURL(path);
423+
config.headers = config.headers !== undefined ? config.headers : {};
423424
if (this.accessToken !== undefined && path !== "login") {
424-
config.headers = config.headers !== undefined ? config.headers : {};
425425
config.headers[ACL_TOKEN_HEADER] = this.accessToken;
426426
}
427427

0 commit comments

Comments
 (0)