MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / handleStaticRoute

Function handleStaticRoute

packages/astro/src/server/middleware.ts:104–120  ·  view source on GitHub ↗
(
  ctx: Parameters<MiddlewareResponseHandler>[0],
  next: Parameters<MiddlewareResponseHandler>[1],
)

Source from the content-addressed store, hash-verified

102};
103
104async function handleStaticRoute(
105 ctx: Parameters<MiddlewareResponseHandler>[0],
106 next: Parameters<MiddlewareResponseHandler>[1],
107): Promise<Response> {
108 const parametrizedRoute = getParametrizedRoute(ctx);
109 try {
110 const originalResponse = await next();
111
112 // We never want to continue a trace here, so we do not inject trace data
113 // But we do want to inject the parametrized route, as this is used for client-side route parametrization
114 const metaTagsStr = getMetaTagsStr({ injectTraceData: false, parametrizedRoute });
115 return injectMetaTagsInResponse(originalResponse, metaTagsStr);
116 } catch (e) {
117 sendErrorToSentry(e);
118 throw e;
119 }
120}
121
122async function enhanceHttpServerSpan(
123 ctx: Parameters<MiddlewareResponseHandler>[0],

Callers 1

handleRequestFunction · 0.85

Calls 5

getParametrizedRouteFunction · 0.85
nextFunction · 0.85
getMetaTagsStrFunction · 0.85
injectMetaTagsInResponseFunction · 0.70
sendErrorToSentryFunction · 0.70

Tested by

no test coverage detected