From 5ae0c52ebb54ecda2af473eca0b19a5f67bf7164 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:23:41 +0100 Subject: [PATCH] ref(browser): Remove truncation when not needed --- packages/browser-utils/src/metrics/lcp.ts | 3 +-- packages/browser/src/integrations/globalhandlers.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/browser-utils/src/metrics/lcp.ts b/packages/browser-utils/src/metrics/lcp.ts index 5f84f1782041..a6410ac08580 100644 --- a/packages/browser-utils/src/metrics/lcp.ts +++ b/packages/browser-utils/src/metrics/lcp.ts @@ -77,8 +77,7 @@ export function _sendStandaloneLcpSpan( entry.element && (attributes['lcp.element'] = htmlTreeAsString(entry.element)); entry.id && (attributes['lcp.id'] = entry.id); - // Trim URL to the first 200 characters. - entry.url && (attributes['lcp.url'] = entry.url.trim().slice(0, 200)); + entry.url && (attributes['lcp.url'] = entry.url); // loadTime is the time of LCP that's related to receiving the LCP element response.. entry.loadTime != null && (attributes['lcp.loadTime'] = entry.loadTime); diff --git a/packages/browser/src/integrations/globalhandlers.ts b/packages/browser/src/integrations/globalhandlers.ts index fa815db7c15e..cc30923273c2 100644 --- a/packages/browser/src/integrations/globalhandlers.ts +++ b/packages/browser/src/integrations/globalhandlers.ts @@ -214,5 +214,5 @@ function getFilenameFromUrl(url: string | undefined): string | undefined { return ``; } - return url.slice(0, 1024); + return url; // it's fine to not truncate it as it's not put in a regex (https://codeql.github.com/codeql-query-help/javascript/js-polynomial-redos) }