From 674093e84cf43f68139695ec51fa56523f1d9f6b Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 28 Apr 2024 14:51:18 +0800 Subject: [PATCH] fix: appName --- packages/core/client/src/api-client/APIClient.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/api-client/APIClient.ts b/packages/core/client/src/api-client/APIClient.ts index e1ef3ca448..c793977026 100644 --- a/packages/core/client/src/api-client/APIClient.ts +++ b/packages/core/client/src/api-client/APIClient.ts @@ -54,8 +54,9 @@ export class APIClient extends APIClientSDK { getHeaders() { const headers = super.getHeaders(); - if (this.app) { - headers['X-App'] = this.app.getName(); + const appName = this.app.getName(); + if (appName) { + headers['X-App'] = appName; } headers['X-Timezone'] = getCurrentTimezone(); headers['X-Hostname'] = window?.location?.hostname;