You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): Only consider ingest endpoint requests when checking isSentryRequestUrl (#17393)
This PR makes a change to our `isSentryRequestUrl` utility which is used
in various parts of the SDKs.
The function checks both, the DSN as well as the `tunnel` option to
determine if a request URL is a URL to Sentry. I would argue, we should
only return `true` for requests to Sentry's ingest endpoint. For
example, if users make regular requests to the Sentry API from within
their app that uses a Sentry SDK, we should not special case that
request.
Therefore, this PR makes the check for the request URL more specific:
- If `tunnel` is not provided, return `true` iff the the url includes
the host of the DSN AND if it includes the `sentry_key` query param.
This param is mandatory to be sent along, as it's equal to the [public
key of the DSN
](https://develop.sentry.dev/sdk/overview/#parsing-the-dsn).
- If `tunnel` is provided, the check was already specific enough because
the request URL has to match _exactly_ the configured tunnel URL.
While writing this, I realized there are still a bunch of edge cases
here that we probably also should fix but for now, let's keep things
atomic.
closes#17385
(^ very likely. We didn't repro this specifically but the
`httpClientIntegration` bails out exactly if it hits the
`isSentryRequestUrl` check)
0 commit comments