Skip to content

fix(core): Gracefully handle invalid baggage entries #16257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented May 12, 2025

Fixes #16251

@mydea mydea requested review from RulaKhaled and andreiborza May 12, 2025 09:39
@mydea mydea self-assigned this May 12, 2025
Comment on lines +120 to +123
} catch {
// We ignore errors here, e.g. if the value cannot be URL decoded.
// This will then be skipped in the next step
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Do we maybe want to add a debug log in case of discarded entries?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this, but this increases bundle size, not sure if worth it? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, alright then probably not worth the tradeoff

Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.36 KB +0.04% +9 B 🔺
@sentry/browser - with treeshaking flags 23.19 KB +0.03% +7 B 🔺
@sentry/browser (incl. Tracing) 37.25 KB +0.02% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) 74.48 KB +0.01% +6 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.35 KB +0.01% +6 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 79.13 KB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 90.94 KB +0.01% +5 B 🔺
@sentry/browser (incl. Feedback) 39.76 KB +0.03% +12 B 🔺
@sentry/browser (incl. sendFeedback) 27.98 KB +0.03% +6 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.75 KB +0.03% +8 B 🔺
@sentry/react 25.17 KB +0.04% +8 B 🔺
@sentry/react (incl. Tracing) 39.24 KB +0.02% +8 B 🔺
@sentry/vue 27.63 KB +0.04% +9 B 🔺
@sentry/vue (incl. Tracing) 39.01 KB +0.02% +5 B 🔺
@sentry/svelte 23.38 KB +0.04% +9 B 🔺
CDN Bundle 24.56 KB +0.04% +9 B 🔺
CDN Bundle (incl. Tracing) 37.3 KB +0.03% +10 B 🔺
CDN Bundle (incl. Tracing, Replay) 72.34 KB +0.02% +10 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 77.65 KB +0.02% +10 B 🔺
CDN Bundle - uncompressed 71.65 KB +0.04% +27 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 110.37 KB +0.03% +27 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 221.65 KB +0.02% +27 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 234.18 KB +0.02% +27 B 🔺
@sentry/nextjs (client) 40.85 KB +0.02% +8 B 🔺
@sentry/sveltekit (client) 37.74 KB +0.02% +7 B 🔺
@sentry/node 151.37 KB +0.01% +6 B 🔺
@sentry/node - without tracing 95.78 KB +0.01% +8 B 🔺
@sentry/aws-serverless 120.17 KB +0.01% +6 B 🔺

View base workflow run

@mydea mydea merged commit 5ed5627 into develop May 12, 2025
157 checks passed
@mydea mydea deleted the fn/catch-baggage-errors branch May 12, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught "URI malformed" error in baggageHeaderToObject due to invalid percent-encoding in baggage header
2 participants