diff --git a/packages/web/src/stores/socialStore.sendRequest.test.ts b/packages/web/src/stores/socialStore.sendRequest.test.ts index 4dc3ef7f..367dddd1 100644 --- a/packages/web/src/stores/socialStore.sendRequest.test.ts +++ b/packages/web/src/stores/socialStore.sendRequest.test.ts @@ -51,6 +51,7 @@ describe('socialStore.sendFriendRequest — case-insensitive domain routing', () // Override it for routing tests. Object.defineProperty(window, 'location', { configurable: true, + writable: true, value: { ...window.location, host: 'local.test', hostname: 'local.test' }, }); }); diff --git a/packages/web/src/stores/socialStore.ts b/packages/web/src/stores/socialStore.ts index d2bef9b8..9a0878e6 100644 --- a/packages/web/src/stores/socialStore.ts +++ b/packages/web/src/stores/socialStore.ts @@ -218,7 +218,6 @@ export const useSocialStore = create((set, get) => ({ res = await api.social.sendRequest(username); } else { const baseName = username.slice(0, atIndex); - // Hostnames are case-insensitive; comparison RHS is canonical lowercase. const domain = username.slice(atIndex + 1).toLowerCase(); // Check if domain matches home instance