fix: pass sentry_key when forwarding envelopes to GlitchTip #31
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/glitchtip-sentry-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #30. That PR was merged before this fix was pushed to its branch.
Problem
GlitchTip answered 403 "Denied" to every browser error forwarded by
/api/glitchtip/envelope, so no browser errors reached GlitchTip. GlitchTip only accepts the project key in the query string (?sentry_key=…&sentry_version=7) and ignores the DSN in the envelope header, which is all the tunnel forwarded. Server-side reporting wasn't affected, because@sentry/nodeadds the key itself.Checked against the live instance with a
client_reportenvelope, which creates no issue: without the key it returns 403{"detail": "Denied"}, and with it, 200.Fix
parseDsnnow buildsenvelopeUrlwithsentry_keyandsentry_version. Tests are updated.Testing
pnpm test src/lib/glitchtip.test.ts,pnpm typecheckandpnpm lintpass.setTimeout(() => { throw new Error('glitchtip test') })in the console.POST /api/glitchtip/envelopeshould return 200, and the issue should show up in GlitchTip.🤖 Generated with Claude Code