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
1 line
2.4 KiB
Plaintext
1 line
2.4 KiB
Plaintext
{"version":3,"file":"tunnelRoute.js","sources":["../../../src/client/tunnelRoute.ts"],"sourcesContent":["import { debug, dsnFromString, GLOBAL_OBJ } from '@sentry/core';\nimport type { BrowserOptions } from '@sentry/react';\nimport { DEBUG_BUILD } from '../common/debug-build';\n\nconst globalWithInjectedValues = GLOBAL_OBJ as typeof GLOBAL_OBJ & {\n _sentryRewritesTunnelPath?: string;\n};\n\n/**\n * Applies the `tunnel` option to the Next.js SDK options based on `withSentryConfig`'s `tunnelRoute` option.\n */\nexport function applyTunnelRouteOption(options: BrowserOptions): void {\n const tunnelRouteOption = process.env._sentryRewritesTunnelPath || globalWithInjectedValues._sentryRewritesTunnelPath;\n if (tunnelRouteOption && options.dsn) {\n const dsnComponents = dsnFromString(options.dsn);\n if (!dsnComponents) {\n return;\n }\n const sentrySaasDsnMatch = dsnComponents.host.match(/^o(\\d+)\\.ingest(?:\\.([a-z]{2}))?\\.sentry\\.io$/);\n if (sentrySaasDsnMatch) {\n const orgId = sentrySaasDsnMatch[1];\n const regionCode = sentrySaasDsnMatch[2];\n let tunnelPath = `${tunnelRouteOption}?o=${orgId}&p=${dsnComponents.projectId}`;\n if (regionCode) {\n tunnelPath += `&r=${regionCode}`;\n }\n options.tunnel = tunnelPath;\n DEBUG_BUILD && debug.log(`Tunneling events to \"${tunnelPath}\"`);\n } else {\n DEBUG_BUILD && debug.warn('Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.');\n }\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,wBAAA,GAA2B;;AAEjC;;AAEA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAAwB;AACtE,EAAE,MAAM,iBAAA,GAAoB,OAAO,CAAC,GAAG,CAAC,yBAAA,IAA6B,wBAAwB,CAAC,yBAAyB;AACvH,EAAE,IAAI,iBAAA,IAAqB,OAAO,CAAC,GAAG,EAAE;AACxC,IAAI,MAAM,gBAAgB,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;AACpD,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,MAAM;AACN,IAAI;AACJ,IAAI,MAAM,kBAAA,GAAqB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,+CAA+C,CAAC;AACxG,IAAI,IAAI,kBAAkB,EAAE;AAC5B,MAAM,MAAM,KAAA,GAAQ,kBAAkB,CAAC,CAAC,CAAC;AACzC,MAAM,MAAM,UAAA,GAAa,kBAAkB,CAAC,CAAC,CAAC;AAC9C,MAAM,IAAI,UAAA,GAAa,CAAC,EAAA,iBAAA,CAAA,GAAA,EAAA,KAAA,CAAA,GAAA,EAAA,aAAA,CAAA,SAAA,CAAA,CAAA;AACA,MAAA,IAAA,UAAA,EAAA;AACA,QAAA,UAAA,IAAA,CAAA,GAAA,EAAA,UAAA,CAAA,CAAA;AACA,MAAA;AACA,MAAA,OAAA,CAAA,MAAA,GAAA,UAAA;AACA,MAAA,WAAA,IAAA,KAAA,CAAA,GAAA,CAAA,CAAA,qBAAA,EAAA,UAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,CAAA,MAAA;AACA,MAAA,WAAA,IAAA,KAAA,CAAA,IAAA,CAAA,gEAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA;;;;"} |