Skip to content
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

fix(core): Add sentry_client to auth headers #5413

Merged
merged 3 commits into from Jul 14, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Jul 12, 2022

This adds sentry_client to the auth headers* we send with every envelope request, as described in the develop docs.

In order to have access to the SDK metadata, the full ClientOptions object is now passed to getEnvelopeEndpointWithUrlEncodedAuth. Despite the fact that this is really an internal function, it's exported, so in order to keep everything backwards-compatible, for the moment it will also accept a string as the second argument, as it has in the past. Finally, all of our internal uses of the function have been switched to passing options, and there's a TODO in place so that we remember to remove the backwards compatibility in v8.

Note that this change doesn't affect anyone using a tunnel, as no auth headers are sent in that case, in order to better cloak store requests from ad blockers.

*The "headers" are actually querystring values, so as not to trigger CORS issues, but the effect is the same

Fixes #5406

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.42 KB (+0.35% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 60.04 KB (+0.26% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18 KB (+0.27% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 52.94 KB (+0.26% 🔺)
@sentry/browser - Webpack (gzipped + minified) 19.76 KB (+0.28% 🔺)
@sentry/browser - Webpack (minified) 64.28 KB (+0.21% 🔺)
@sentry/react - Webpack (gzipped + minified) 19.79 KB (+0.28% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 44.08 KB (+0.13% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.87 KB (+0.2% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.12 KB (+0.23% 🔺)

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

LGTM - Nice tests!

@lobsterkatie lobsterkatie merged commit c39e640 into master Jul 14, 2022
@lobsterkatie lobsterkatie deleted the kmclb-add-sentry_client-to-auth-headers branch July 14, 2022 13:54
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.

Send sentry_client as query param
2 participants