Skip to content

Commit b79ad75

Browse files
Merge pull request #34 from Sydney-o9/master
Fix issue where setSlashApiKey would break if no headers was set.
2 parents 62be8bf + 2f720a1 commit b79ad75

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)