Title: MIGRATION.md: v10 to v11 `dataCollection` example silently collects all HTTP headers · Issue #23168 · getsentry/sentry-javascript · GitHub
Open Graph Title: MIGRATION.md: v10 to v11 `dataCollection` example silently collects all HTTP headers · Issue #23168 · getsentry/sentry-javascript
X Title: MIGRATION.md: v10 to v11 `dataCollection` example silently collects all HTTP headers · Issue #23168 · getsentry/sentry-javascript
Description: The "keep the v10 default behavior" snippet in the sendDefaultPii is replaced by dataCollection section produces the opposite of its stated effect for httpHeaders. The problem The snippet under #### If you want to keep the v10 default be...
Open Graph Description: The "keep the v10 default behavior" snippet in the sendDefaultPii is replaced by dataCollection section produces the opposite of its stated effect for httpHeaders. The problem The snippet under ###...
X Description: The "keep the v10 default behavior" snippet in the sendDefaultPii is replaced by dataCollection section produces the opposite of its stated effect for httpHeaders. The problem The snippet...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/23168
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MIGRATION.md: v10 to v11 `dataCollection` example silently collects all HTTP headers","articleBody":"The \"keep the v10 default behavior\" snippet in the [`sendDefaultPii` is replaced by `dataCollection`](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#senddefaultpii-is-replaced-by-datacollection) section produces the opposite of its stated effect for `httpHeaders`.\n\n## The problem\n\nThe snippet under `#### If you want to keep the v10 default behavior` says:\n\n```js\nSentry.init({\n dataCollection: {\n // ...\n httpHeaders: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },\n // ...\n },\n});\n```\n\nBut `httpHeaders` is not a `CollectBehavior`. Per `packages/core/src/types/datacollection.ts`:\n\n```ts\nhttpHeaders?: {\n request?: CollectBehavior;\n response?: CollectBehavior;\n};\n```\n\nAnd `packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts` resolves it as:\n\n```ts\nhttpHeaders: {\n request: dc.httpHeaders?.request ?? DEFAULTS.httpHeaders.request, // -> true\n response: dc.httpHeaders?.response ?? DEFAULTS.httpHeaders.response, // -> true\n},\n```\n\nA bare `deny` key matches neither `request` nor `response`, so both fall through to the `true` default and **every header is collected** — precisely what the snippet claims to prevent. Anyone following the guide to preserve `sendDefaultPii: false` ends up with full header collection instead.\n\n## Correct form\n\n```js\nhttpHeaders: {\n request: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },\n response: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },\n},\n```\n\n## Note\n\nThe guide contradicts itself here. About ten lines below the snippet it correctly states:\n\n> Each key-value field (`cookies`, `urlQueryParams`, `httpHeaders.request`, `httpHeaders.response`) accepts `true`, `false`, `{ allow: string[] }`, or `{ deny: string[] }` for fine-grained control.\n\n## Severity\n\nTypeScript users are protected — the wrong shape fails to compile:\n\n```\nerror TS2353: Object literal may only specify known properties, and 'deny' does not\nexist in type '{ request?: CollectBehavior | undefined; response?: CollectBehavior | undefined; }'.\n```\n\nJavaScript configs fail **silently**, with no warning, in a privacy-sensitive direction, while the user believes they have opted out of header collection.\n\nFound while migrating a few apps to `11.0.0-alpha.0`. Confirmed present on `develop` at time of writing.\n","author":{"url":"https://github.com/andreiborza","@type":"Person","name":"andreiborza"},"datePublished":"2026-08-07T18:03:06Z","url":"https://github.com/getsentry/sentry-javascript/issues/23168"}
| 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:6105d51e-b4c1-f7de-47cc-e02a453788c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A816:BBCAB:44BAEB:5C8C65:6B04F53C |
| html-safe-nonce | 31ee4b329146b9f207306016a92d5978ff67646df7454ba90e39269a2b0b1e8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODE2OkJCQ0FCOjQ0QkFFQjo1QzhDNjU6NkIwNEY1M0MiLCJ2aXNpdG9yX2lkIjoiNjIxMTk2MDEzNDI4NjI0MzEzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f13d636fc5693d6c36f5d672da3366c4b4763cff9902ee9127ad73508d661816 |
| hovercard-subject-tag | issue:5092764337 |
| 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/23168/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3accae7f4b9a2f392b5b0e81398e68a0a6beb238cb0816a5ebcf220da4fa0768/getsentry/sentry-javascript/issues/23168 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3accae7f4b9a2f392b5b0e81398e68a0a6beb238cb0816a5ebcf220da4fa0768/getsentry/sentry-javascript/issues/23168 |
| og:image:alt | The "keep the v10 default behavior" snippet in the sendDefaultPii is replaced by dataCollection section produces the opposite of its stated effect for httpHeaders. The problem The snippet under ###... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreiborza |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2c3971d6ab4be607cf9a26ac26ef0a7bfce380ec2ba14642e64028ad07a492b9 |
| 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 | b3f1d45dee14b3f87c64e9017a9c08d011561786 |
| 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