fix(core): Add sentry_client
to auth headers
#5413
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 togetEnvelopeEndpointWithUrlEncodedAuth
. 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 passingoptions
, and there's aTODO
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