fix(social-client): lowercase parsed @domain in sendFriendRequest

Hostnames are case-insensitive (RFC 4343), and both right-hand
sides of the routing comparisons (window.location.host and
URL.host) are already canonical lowercase. The user-typed domain
substring was compared with strict ===, so ORBIT.ddns.net
failed to match an existing connected peer and popped a spurious
Connect Instance modal. Normalize at parse time.
This commit is contained in:
Jannis Braun
2026-04-25 19:20:07 +02:00
parent b5b48e407e
commit fba1f0b87d
2 changed files with 89 additions and 1 deletions
+2 -1
View File
@@ -218,7 +218,8 @@ export const useSocialStore = create<SocialState>((set, get) => ({
res = await api.social.sendRequest(username);
} else {
const baseName = username.slice(0, atIndex);
const domain = username.slice(atIndex + 1);
// Hostnames are case-insensitive; comparison RHS is canonical lowercase.
const domain = username.slice(atIndex + 1).toLowerCase();
// Check if domain matches home instance
if (domain === window.location.host) {