Title: Make `tracePropagationTargets` matching case-insensitive · Issue #16018 · getsentry/sentry-javascript · GitHub
Open Graph Title: Make `tracePropagationTargets` matching case-insensitive · Issue #16018 · getsentry/sentry-javascript
X Title: Make `tracePropagationTargets` matching case-insensitive · Issue #16018 · getsentry/sentry-javascript
Description: Problem Statement Currently, we have a bit of an obscure problem with tracePropagationTargets: If users make a fetch request to a URL with casing (for whatever reason), they likely apply the same casing when defining tracePropagationTarg...
Open Graph Description: Problem Statement Currently, we have a bit of an obscure problem with tracePropagationTargets: If users make a fetch request to a URL with casing (for whatever reason), they likely apply the same c...
X Description: Problem Statement Currently, we have a bit of an obscure problem with tracePropagationTargets: If users make a fetch request to a URL with casing (for whatever reason), they likely apply the same c...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/16018
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make `tracePropagationTargets` matching case-insensitive","articleBody":"### Problem Statement\n\nCurrently, we have a bit of an obscure problem with `tracePropagationTargets`:\n\nIf users make a fetch request to a URL with casing (for whatever reason), they likely apply the same casing when defining `tracePropagationTargets`:\n\n```js\nSentry.init({\n tracePropagationTargets: ['myApi.com', /^myApi.com\\/.*/]\n})\n\nfetch('https://myApi.com');\n```\n\nUnfortunately, the values in `tracePropagationTargets` counter-intuitively don't match because[ we create a](\u003chttps://github.com/getsentry/sentry-javascript/blob/67f4919b9f6d9067363e0bdc792ce242fdc98749/packages/browser/src/tracing/request.ts#L292-L293>) `new URL()` from the URL passed to `fetch` when determining if our tracing headers should be attached.\n\nThe constructed `URL` object converts the entered url though to all-lower-case, meaning that when matching `myapi.com` against both, the string or the regex, we wouldn't get a positive match. Therefore, the currently correct way of specifying TPT for this URL would any one of :\n\n```js\nSentry.init({\n tracePropagationTargets: [\n 'myapi.com', \n /^myapi.com/,\n /^myApi.com/i,\n]\n})\n```\n\n### Solution Brainstorm\n\nFor simplicity, we propose to convert all entries in `tracePropagationTargets` `.toLower()` and add a case insensitivity `/i` flag to `RegExp` values.\n\nWe're a bit worried though about subtly breaking existing setups that perhaps rely on case sensitivity. Therefore we consider this behaviour-breaking and opt to make the change in the next major.\u003cbr>(Also, intuitively, this sounds like a niche/edge case as it's rather uncommon to capitalize URLs)","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2025-04-09T11:59:30Z","url":"https://github.com/getsentry/sentry-javascript/issues/16018"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:440a8a50-20f2-ca65-51ee-109133cf3cf9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6D6:3047DC:71C158:965EE2:6B04C873 |
| html-safe-nonce | e3e832bc6a6268643a7dde439b8a9376190600a790cbfb78c1189753627261cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkQ2OjMwNDdEQzo3MUMxNTg6OTY1RUUyOjZCMDRDODczIiwidmlzaXRvcl9pZCI6IjM5NzMyMTIwMDQ2NTkwMjE5MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9a61ca53baa2a63115577c9d25bde0f9468b2a9dc1d134f95a1d1e8b96721584 |
| hovercard-subject-tag | issue:2982597493 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/16018/issue_layout |
| twitter:image | https://opengraph.githubassets.com/433fb28eb016f7365cef941acae2f8fff71fda874f13254cb3f1823383601ac0/getsentry/sentry-javascript/issues/16018 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/433fb28eb016f7365cef941acae2f8fff71fda874f13254cb3f1823383601ac0/getsentry/sentry-javascript/issues/16018 |
| og:image:alt | Problem Statement Currently, we have a bit of an obscure problem with tracePropagationTargets: If users make a fetch request to a URL with casing (for whatever reason), they likely apply the same c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width