Send back response from sentry through tunnel
All checks were successful
Test, Build, Deploy / Test, Build, and Deploy (push) Successful in 54s
Test, Build, Deploy / Create Sentry Release (push) Successful in 7s

This commit is contained in:
2026-03-14 01:47:42 -04:00
parent 7352d0bb43
commit 8e34e2ce24

View File

@@ -12,7 +12,9 @@ export async function onRequestPost(context: RequestContext) {
const sentryUrl = new URL(dsn); const sentryUrl = new URL(dsn);
await fetch(`https://${sentryUrl.host}/api${sentryUrl.pathname}/envelope`, { const resp = await fetch(
`https://${sentryUrl.host}/api${sentryUrl.pathname}/envelope`,
{
body: clonedRequest.body, body: clonedRequest.body,
headers: { headers: {
"content-type": "application/x-sentry-envelope", "content-type": "application/x-sentry-envelope",
@@ -21,9 +23,13 @@ export async function onRequestPost(context: RequestContext) {
) as string, ) as string,
}, },
method: "POST", method: "POST",
}); },
);
return new Response(null, { return new Response(await resp.text(), {
status: 204, headers: {
"content-type": resp.headers.get("content-type") || "text/plain",
},
status: resp.status,
}); });
} }