Skip to content

fix(browser): Respect dataCollection.httpHeaders.request in httpContextIntegration - #23025

Draft
chargome wants to merge 1 commit into
developfrom
feat/js-2657-httpcontext-data-collection
Draft

fix(browser): Respect dataCollection.httpHeaders.request in httpContextIntegration#23025
chargome wants to merge 1 commit into
developfrom
feat/js-2657-httpcontext-data-collection

Conversation

@chargome

@chargome chargome commented Aug 4, 2026

Copy link
Copy Markdown
Member

httpContextIntegration attached Referer and User-Agent without looking at dataCollection, so httpHeaders: { request: false } worked on the server but did nothing in the browser. Both hooks now filter through httpHeaders.request.

Headers the user sets themselves are left alone, matching the spec and the server.

Note the URL stays unfiltered: url.full ignores urlQueryParams on both platforms, so ?token=… still gets sent. Pre-existing and untouched here, but probably worth its own issue.

closes #21272

…ntextIntegration`

`httpContextIntegration` attached `Referer` and `User-Agent` without looking at
`dataCollection`, so `httpHeaders: { request: false }` worked on the server but did
nothing in the browser. Both hooks now filter through `httpHeaders.request`.

Filtering goes by header name rather than by what this integration collects, because
`browserTracingIntegration` puts the same two headers on transaction events before this
hook runs. Headers the user sets themselves are left alone, matching the spec and the
server.

Fixes #21272

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Aug 4, 2026
@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

JS-2657

@chargome

chargome commented Aug 4, 2026

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 976507c. Configure here.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.12 kB +1.08% +320 B 🔺
@sentry/browser - with treeshaking flags 28.34 kB +1.15% +322 B 🔺
@sentry/browser (incl. Tracing) 47.53 kB +0.68% +318 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.52 kB +0.65% +304 B 🔺
@sentry/browser (incl. Tracing, Profiling) 52.27 kB +0.61% +314 B 🔺
@sentry/browser (incl. Tracing, Replay) 86.9 kB +0.42% +358 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.33 kB +0.46% +344 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 91.62 kB +0.39% +354 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 104.23 kB +0.34% +345 B 🔺
@sentry/browser (incl. Feedback) 47.45 kB +0.74% +348 B 🔺
@sentry/browser (incl. sendFeedback) 34.97 kB +0.96% +330 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.09 kB +0.86% +341 B 🔺
@sentry/browser (incl. Metrics) 31.18 kB +1.02% +314 B 🔺
@sentry/browser (incl. Logs) 31.42 kB +1.01% +313 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.09 kB +1% +316 B 🔺
@sentry/react 31.91 kB +1.03% +324 B 🔺
@sentry/react (incl. Tracing) 49.76 kB +0.61% +297 B 🔺
@sentry/vue 35.18 kB +0.91% +314 B 🔺
@sentry/vue (incl. Tracing) 49.49 kB +0.61% +298 B 🔺
@sentry/svelte 30.14 kB +1.07% +319 B 🔺
CDN Bundle 32.17 kB +0.94% +297 B 🔺
CDN Bundle (incl. Tracing) 47.87 kB +0.68% +323 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.71 kB +0.92% +307 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.23 kB +0.59% +285 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.06 kB +0.43% +310 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.49 kB +0.37% +307 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.81 kB +0.35% +302 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.31 kB +0.34% +304 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.62 kB +0.33% +302 B 🔺
CDN Bundle - uncompressed 95.47 kB +0.81% +767 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 142.94 kB +0.54% +767 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.09 kB +0.78% +767 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.92 kB +0.53% +767 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.79 kB +0.35% +767 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.2 kB +0.3% +767 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.17 kB +0.29% +767 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.9 kB +0.28% +767 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.86 kB +0.28% +767 B 🔺
@sentry/nextjs (client) 52.34 kB +0.6% +311 B 🔺
@sentry/sveltekit (client) 47.97 kB +0.68% +320 B 🔺
@sentry/core/server 65.5 kB - -
@sentry/core/browser 51.84 kB - -
@sentry/node 120.19 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.64 kB -0.01% -1 B 🔽
@sentry/aws-serverless 92.3 kB - -
@sentry/cloudflare (withSentry) - minified 218.64 kB - -
@sentry/cloudflare (withSentry) 538.65 kB - -

View base workflow run

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.

[v11] Align attaching header data in browser with how it works in Node

1 participant