From 4c783fcaecc4729aa44140877d44c416cb98afa1 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Thu, 20 Apr 2023 19:17:12 +0800 Subject: [PATCH] chore: add caution for primary domain util --- packages/app-insights/src/react/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/app-insights/src/react/utils.ts b/packages/app-insights/src/react/utils.ts index 97a36bf92..636664f4b 100644 --- a/packages/app-insights/src/react/utils.ts +++ b/packages/app-insights/src/react/utils.ts @@ -1 +1,5 @@ +/** + * **CAUTION:** This function takes the last two parts of the hostname which may cause issues for + * some second-level domains, e.g. `.co.uk`. + */ export const getPrimaryDomain = () => window.location.hostname.split('.').slice(-2).join('.');