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

Function onRequest

packages/astro/src/integration/middleware/index.ts:15–24  ·  view source on GitHub ↗
(ctx, next)

Source from the content-addressed store, hash-verified

13 * `/src/middleware.js` file.
14 */
15export const onRequest: MiddlewareHandler = (ctx, next) => {
16 const middleware = handleRequest();
17
18 // `onRequest` deliberately uses framework-agnostic parameter types so the published
19 // `@sentry/astro/middleware` declaration does not reference Astro-version-specific types
20 // (e.g. `MiddlewareResponseHandler`, which is absent in some supported Astro versions).
21 // The handler returned by `handleRequest()` is typed against Astro's own types, so we cast
22 // back to its expected parameter types here – the runtime shapes are identical.
23 return middleware(ctx as Parameters<typeof middleware>[0], next as Parameters<typeof middleware>[1]);
24};

Callers 2

index.test.tsFile · 0.90
index.tsFile · 0.85

Calls 2

handleRequestFunction · 0.90
middlewareFunction · 0.50

Tested by

no test coverage detected