Skip to content

Commit 2f720a1

Browse files
committed
Fix issue where setSlashApiKey would break if no headers was set.
1 parent 62be8bf commit 2f720a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/clientStub.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export class DgraphClientStub {
377377
}
378378

379379
public setSlashApiKey(apiKey: string) {
380+
this.options.headers === undefined && (this.options.headers = {});
380381
this.options.headers[SLASH_API_KEY_HEADER] = apiKey;
381382
}
382383

0 commit comments

Comments
 (0)