This commit is contained in:
bracesproul
2024-10-15 11:37:20 -07:00
parent 7352ab14a2
commit 433c382280
+4 -1
View File
@@ -87,7 +87,10 @@ class BaseClient {
this.timeoutMs = config?.timeoutMs || 12_000;
this.apiUrl = config?.apiUrl || "http://localhost:8123";
this.defaultHeaders = config?.defaultHeaders || {};
this.defaultHeaders["X-Api-Key"] = getApiKey(config?.apiKey);
const apiKey = getApiKey(config?.apiKey);
if (apiKey) {
this.defaultHeaders["X-Api-Key"] = apiKey;
}
}
protected prepareFetchOptions(