Files
klz-cables.com/.pnpm-store/v10/files/31/619a014b43f4c82cf6bb322d08a3c455901b46ea676d8a5a744e15ef7c4299b6285461a2cc152ce45629383ca1854c03023443b19d86416b0a84be3cbafc6b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

47 lines
1.6 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const urls = require('./urls.js');
/**
* Sets the URL processing metadata for the event.
*/
function setUrlProcessingMetadata(event) {
// Skip if not a server-side transaction
if (event.type !== 'transaction' || event.contexts?.trace?.op !== 'http.server' || !event.contexts?.trace?.data) {
return;
}
// Only add URL if sendDefaultPii is enabled, as URLs may contain PII
const client = core.getClient();
if (!client?.getOptions().sendDefaultPii) {
return;
}
const traceData = event.contexts.trace.data;
// Get the route from trace data
const componentRoute = traceData['next.route'] || traceData['http.route'];
const httpTarget = traceData['http.target'] ;
if (!componentRoute) {
return;
}
// Extract headers
const isolationScopeData = event.sdkProcessingMetadata?.capturedSpanIsolationScope?.getScopeData();
const headersDict = isolationScopeData?.sdkProcessingMetadata?.normalizedRequest?.headers;
const url = urls.getSanitizedRequestUrl(componentRoute, undefined, headersDict, httpTarget?.toString());
// Add URL to the isolation scope's normalizedRequest so requestDataIntegration picks it up
if (url && isolationScopeData?.sdkProcessingMetadata) {
isolationScopeData.sdkProcessingMetadata.normalizedRequest =
isolationScopeData.sdkProcessingMetadata.normalizedRequest || {};
isolationScopeData.sdkProcessingMetadata.normalizedRequest.url = url;
}
}
exports.setUrlProcessingMetadata = setUrlProcessingMetadata;
//# sourceMappingURL=setUrlProcessingMetadata.js.map