diff --git a/src/hooks/useNostrPublish.ts b/src/hooks/useNostrPublish.ts index f5d9c02..6d80c4b 100644 --- a/src/hooks/useNostrPublish.ts +++ b/src/hooks/useNostrPublish.ts @@ -21,8 +21,12 @@ export function useNostrPublish(): UseMutationResult< if (user) { const tags = t.tags ?? []; + const { hostname } = location; + const isLocalhost = hostname === "localhost" || hostname.endsWith(".localhost"); + const isIpAddress = /^\d{1,3}(\.\d{1,3}){3}$/.test(hostname) || hostname.startsWith("["); + // Add the client tag if it doesn't exist - if (location.protocol === "https:" && !tags.some(([name]) => name === "client")) { + if (location.protocol === "https:" && !isLocalhost && !isIpAddress && !tags.some(([name]) => name === "client")) { tags.push(["client", location.hostname]); }