UNPKG

@sentry/nextjs

Version:
18 lines (14 loc) • 850 B
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = require('@sentry/core'); const TUNNEL_ROUTE_HANDLER_PATH = "/sentry-tunnel"; function isPathnameUnderSentryTunnelRoute(pathname, tunnelPath) { return pathname === tunnelPath || pathname.startsWith(`${tunnelPath}/`); } function getTunnelRouteRequestPattern(tunnelPath, tunnelRouteMode) { const pathPattern = `^${core.escapeStringForRegex(tunnelPath)}/?`; return tunnelRouteMode === "handler" ? new RegExp(`${pathPattern}(?:\\?|$)`) : new RegExp(`${pathPattern}\\?o=\\d+&p=\\d+(?:&r=[a-z]{2})?$`); } exports.TUNNEL_ROUTE_HANDLER_PATH = TUNNEL_ROUTE_HANDLER_PATH; exports.getTunnelRouteRequestPattern = getTunnelRouteRequestPattern; exports.isPathnameUnderSentryTunnelRoute = isPathnameUnderSentryTunnelRoute; //# sourceMappingURL=tunnelPathnameMatch.js.map