Files
klz-cables.com/.pnpm-store/v10/files/81/ea2d725c063de2cb9c7e5c3ac15662bc0eb48cb4ac333007c4b3993b41792dd1b0769b7293dd84988e6ff68d2eec69626f3b4cc7ec60bf46ac76ab97c5db95
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

36 lines
1.3 KiB
Plaintext

import { GLOBAL_OBJ, dsnFromString, debug } from '@sentry/core';
import { DEBUG_BUILD } from '../common/debug-build.js';
const globalWithInjectedValues = GLOBAL_OBJ
;
/**
* Applies the `tunnel` option to the Next.js SDK options based on `withSentryConfig`'s `tunnelRoute` option.
*/
function applyTunnelRouteOption(options) {
const tunnelRouteOption = process.env._sentryRewritesTunnelPath || globalWithInjectedValues._sentryRewritesTunnelPath;
if (tunnelRouteOption && options.dsn) {
const dsnComponents = dsnFromString(options.dsn);
if (!dsnComponents) {
return;
}
const sentrySaasDsnMatch = dsnComponents.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);
if (sentrySaasDsnMatch) {
const orgId = sentrySaasDsnMatch[1];
const regionCode = sentrySaasDsnMatch[2];
let tunnelPath = `${tunnelRouteOption}?o=${orgId}&p=${dsnComponents.projectId}`;
if (regionCode) {
tunnelPath += `&r=${regionCode}`;
}
options.tunnel = tunnelPath;
DEBUG_BUILD && debug.log(`Tunneling events to "${tunnelPath}"`);
} else {
DEBUG_BUILD && debug.warn('Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.');
}
}
}
export { applyTunnelRouteOption };
//# sourceMappingURL=tunnelRoute.js.map