Skip to content

feat(core): Accept CollectBehavior shorthand for dataCollection.httpHeaders - #24336

Merged
chargome merged 1 commit into
developfrom
http-headers-shorthand
Sep 11, 2026
Merged

feat(core): Accept CollectBehavior shorthand for dataCollection.httpHeaders#24336
chargome merged 1 commit into
developfrom
http-headers-shorthand

Conversation

@chargome

Copy link
Copy Markdown
Member

dataCollection.httpHeaders is documented as accepting true, false, { allow } or { deny }, but the resolver only understood { request, response }, so a shorthand was silently ignored and both directions fell back to true.

The resolver now applies a CollectBehavior shorthand to both directions, while {} and directional objects keep the existing per-direction merge.

Fixes #24335

…tpHeaders`

The docs and the v10.57 changelog advertise `httpHeaders: { deny: [...] }`,
but the resolver only understood the `{ request, response }` shape, so a
shorthand silently fell through to the defaults. Normalize a boolean or
allow/deny object into both directions while keeping `{}` and directional
objects on the existing merge path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b4af1ad. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.96 kB +0.15% +41 B 🔺
@sentry/browser - with treeshaking flags 27.26 kB +0.16% +41 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.15 kB +0.16% +42 B 🔺
@sentry/browser (incl. Tracing) 50.48 kB +0.12% +59 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 50.48 kB +0.12% +56 B 🔺
@sentry/browser (incl. Tracing, Profiling) 53.47 kB +0.11% +56 B 🔺
@sentry/browser (incl. Tracing, Replay) 89.98 kB +0.06% +45 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.1 kB +0.07% +50 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 94.68 kB +0.05% +45 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 107.69 kB +0.04% +43 B 🔺
@sentry/browser (incl. Feedback) 46.46 kB +0.11% +50 B 🔺
@sentry/browser (incl. sendFeedback) 34.01 kB +0.13% +41 B 🔺
@sentry/browser (incl. FeedbackAsync) 39.12 kB +0.11% +42 B 🔺
@sentry/browser (incl. Metrics) 29.98 kB +0.16% +45 B 🔺
@sentry/browser (incl. Logs) 30.24 kB +0.16% +48 B 🔺
@sentry/browser (incl. Metrics & Logs) 30.91 kB +0.15% +45 B 🔺
@sentry/react 30.72 kB +0.14% +42 B 🔺
@sentry/react (incl. Tracing) 52.77 kB +0.09% +44 B 🔺
@sentry/vue 36.2 kB +0.13% +44 B 🔺
@sentry/vue (incl. Tracing) 52.71 kB +0.1% +48 B 🔺
@sentry/svelte 28.98 kB +0.15% +43 B 🔺
CDN Bundle 30.7 kB +0.14% +42 B 🔺
CDN Bundle (incl. Tracing) 50.97 kB +0.09% +45 B 🔺
CDN Bundle (incl. Logs, Metrics) 32.98 kB +0.14% +43 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 52.95 kB +0.09% +44 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.67 kB +0.06% +42 B 🔺
CDN Bundle (incl. Tracing, Replay) 88.52 kB +0.05% +40 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.48 kB +0.06% +49 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 94.59 kB +0.05% +45 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.59 kB +0.05% +43 B 🔺
CDN Bundle - uncompressed 90.83 kB +0.12% +102 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 152.27 kB +0.07% +102 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.41 kB +0.11% +102 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.24 kB +0.07% +102 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.82 kB +0.05% +102 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.84 kB +0.04% +102 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.79 kB +0.04% +102 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.54 kB +0.04% +102 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.48 kB +0.04% +102 B 🔺
@sentry/nextjs (client) 55.09 kB +0.08% +42 B 🔺
@sentry/sveltekit (client) 50.88 kB +0.11% +51 B 🔺
@sentry/core/server 37.13 kB +0.13% +45 B 🔺
@sentry/core/browser 13.66 kB - -
@sentry/node 129.82 kB +0.06% +68 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.83 kB - -
@sentry/node - without tracing 89.62 kB +0.1% +82 B 🔺
@sentry/node - without channel injection 108.7 kB +0.07% +69 B 🔺
@sentry/aws-serverless 97.84 kB +0.08% +70 B 🔺
@sentry/cloudflare (withSentry) - minified 203.21 kB +0.1% +194 B 🔺
@sentry/cloudflare (withSentry) 505.9 kB +0.1% +468 B 🔺

View base workflow run

@chargome chargome self-assigned this Sep 11, 2026
@chargome
chargome marked this pull request as ready for review September 11, 2026 11:28
@chargome
chargome requested a review from s1gr1d September 11, 2026 11:28
@chargome
chargome merged commit a72af87 into develop Sep 11, 2026
616 of 622 checks passed
@chargome
chargome deleted the http-headers-shorthand branch September 11, 2026 12:11
chargome added a commit that referenced this pull request Sep 11, 2026
…n.httpHeaders` (#24339)

Backport of: #24336

## Differences to the original PR

- `packages/core/src/index.ts`: dropped the `HttpHeadersCollection` type
export. v10 does not export any of the `datacollection` types
(`CollectBehavior`, `DataCollection`, ...) from the core index, so there
was no export list to add it to.
-
`packages/core/src/utils/data-collection/resolveDataCollectionOptions.ts`:
`resolveHttpHeaders` takes the resolved `base` instead of reading
`DEFAULTS` directly. v10 still has the `sendDefaultPii` bridge, so
omitted directions must fall back to whichever base is in effect,
matching the surrounding code.
- `packages/core/src/types/datacollection.ts`: `ResolvedDataCollection`
omits `'queryParams' | 'httpHeaders'`. v10 already omitted the
deprecated `queryParams` key, and the accompanying `todo(v11)` comment
was updated to match.
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.

Support shorthand for dataCollection.httpHeaders

2 participants