From 538035c452bfbc042961b199c0f44e733c88bfab Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Wed, 4 Feb 2026 13:45:32 +0000 Subject: feat: add extra instrumentation in the otel traces (#2453) --- apps/workers/network.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/workers/network.ts') diff --git a/apps/workers/network.ts b/apps/workers/network.ts index 4bc30562..2ef8483f 100644 --- a/apps/workers/network.ts +++ b/apps/workers/network.ts @@ -86,6 +86,15 @@ function isAddressForbidden(address: string): boolean { return DISALLOWED_IP_RANGES.has(parsed.range()); } +export function getBookmarkDomain(url?: string | null): string | undefined { + if (!url) return undefined; + try { + return new URL(url).hostname; + } catch { + return undefined; + } +} + export type UrlValidationResult = | { ok: true; url: URL } | { ok: false; reason: string }; -- cgit v1.2.3-70-g09d2