René's URL Explorer Experiment


Title: Baggage header propagation is dropping property values · Issue #17845 · getsentry/sentry-javascript · GitHub

Open Graph Title: Baggage header propagation is dropping property values · Issue #17845 · getsentry/sentry-javascript

X Title: Baggage header propagation is dropping property values · Issue #17845 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...

Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/17845

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Baggage header propagation is dropping property values","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\nlatest\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\ntest.js file\n\n```javascript\nconst Sentry = require('@sentry/node');\n\nSentry.init({\n  dsn: 'https://public@sentry.example.com/1\"',\n  // ...\n});\n\nconst http = require('http');\n\nconst options = {\n  hostname: 'localhost',\n  port: 8080,\n  headers: {\n    baggage: 'key1=value1;property1;property2, key2 = value2, key3=value3; propertyKey=propertyValue'\n  }\n};\n\nhttp.get(options);\n```\n\n### Steps to Reproduce\n\nRequests containing a baggage header with property values sent from a nodejs app using sentry results in those baggage property values being dropped.\n\nExample baggage header (taken from [w3c spec](https://www.w3.org/TR/baggage/#example)):\n\n`baggage: key1=value1;property1;property2, key2 = value2, key3=value3; propertyKey=propertyValue`\n\nThe resulting baggage header is modified to:\n\n`baggage: key1=value1%3Bproperty1%3Bproperty2,key2=value2,key3=value3%3B%20propertyKey,sentry-environment=production,sentry-public_key=public,sentry-trace_id=3c04e02e27e644f2af89b05b02a1b120`\n\nThe metadata associated with `key3` has `=propertyValue` truncated.\n\n**Steps to recreate**\n\n```shell\nnc -l localhost 8080 & node test.js && wait\n\nGET / HTTP/1.1\nbaggage: key1=value1%3Bproperty1%3Bproperty2,key2=value2,key3=value3%3B%20propertyKey,sentry-environment=production,sentry-public_key=public,sentry-trace_id=3c04e02e27e644f2af89b05b02a1b120\nHost: localhost:8080\nsentry-trace: 3c04e02e27e644f2af89b05b02a1b120-98a5af2e203aec16\nConnection: keep-alive\n```\n\n### Expected Result\n\nThe baggage header preserves all metadata (incl properties) associated with a baggage key.\n\n`baggage: key1=value1%3Bproperty1%3Bproperty2,key2=value2,key3=value3%3B%20propertyKey%3DpropertyValue,sentry-environment=production,sentry-public_key=public,sentry-trace_id=3c04e02e27e644f2af89b05b02a1b120`\n\nor unencoded as\n`key1=value1;property1;property2,key2=value2,key3=value3; propertyKey=propertyValue,sentry-environment=production,sentry-public_key=public,sentry-trace_id=3c04e02e27e644f2af89b05b02a1b120`\n\n\n### Actual Result\n\nThe actual result is that the propertyValue metadata property value associated with key3 is lost:\n\n`baggage: key1=value1%3Bproperty1%3Bproperty2,key2=value2,key3=value3%3B%20propertyKey,sentry-environment=production,sentry-public_key=public,sentry-trace_id=3c04e02e27e644f2af89b05b02a1b120`\n\n### Additional Context\n\nAccording to the [W3C baggage spec](https://www.w3.org/TR/baggage/) parsers must adhere to the following.\n\n> Note, value MAY contain any number of the equal sign (U+003D) code points. Parsers **MUST NOT** assume that the equal sign is only used to separate key and value.\n\nProperty metadata description\n\n> Additional metadata MAY be appended to values in the form of property set, represented as semi-colon ; delimited list of keys and/or key-value pairs, e.g. ;k1=v1;k2;k3=v3. Property keys and values are given no specific meaning by this specification. Leading and trailing OWS is allowed and is not considered to be a part of the property key or value.\n\nhttps://www.w3.org/TR/baggage/#property\n\nTest cases from w3c baggage github.\n\n```python\n    def test_parse_kv_property(self):\n        entry = BaggageEntry.from_string(\n            \"SomeKey=SomeValue;SomePropKey=SomePropValue\")\n        self.assertEqual(entry.key, \"SomeKey\")\n        self.assertEqual(entry.value, \"SomeValue\")\n        self.assertEqual(len(entry.properties), 1)\n        self.assertEqual(entry.properties[0].key, \"SomePropKey\")\n        self.assertEqual(entry.properties[0].value, \"SomePropValue\")\n\n```\n\nhttps://github.com/w3c/baggage/blob/main/test/test_baggage.py#L151-L158\n\nIt appears the bug is located in this function:\n\nhttps://github.com/getsentry/sentry-javascript/blob/379b539c4a113a68a75301906458770bc8ae7422/packages/core/src/utils/baggage.ts#L113-L133\n\nThe `reduce` function is only taking the first two values after splitting on '='. This is problematic as any key metadata property value will be lost. A corrected function would look something like:\n\n```javascript\nfunction baggageHeaderToObject(baggageHeader) {\n  return baggageHeader\n    .split(',')\n    .map(baggageEntry => {\n      const eqIdx = baggageEntry.indexOf('=');\n      if (eqIdx === -1) {\n        return [];\n      }\n      const key = baggageEntry.slice(0, eqIdx);\n      const value = baggageEntry.slice(eqIdx + 1);\n      return [key, value].map(keyOrValue => {\n        try {\n          return decodeURIComponent(keyOrValue.trim());\n        } catch {\n          // We ignore errors here, e.g. if the value cannot be URL decoded.\n          // This will then be skipped in the next step\n          return;\n        }\n      });\n    })\n    .reduce((acc, [key, value]) => {\n      if (key && value) {\n        acc[key] = value;\n      }\n      return acc;\n    }, {});\n}\n```\n\n\n\u003csub>Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/zandt-square","@type":"Person","name":"zandt-square"},"datePublished":"2025-10-01T22:49:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/17845"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:177e229b-e2e9-282e-323f-05d226c28608
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EAE:3644F3:830547:ADDCFC:6B04ECE2
html-safe-nonce715f0d95f17a6b7dec5538fef1932f0df436754671120258794c9d08c66be546
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUFFOjM2NDRGMzo4MzA1NDc6QUREQ0ZDOjZCMDRFQ0UyIiwidmlzaXRvcl9pZCI6IjkxNjUwMzczOTM0MDQwMzAxNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb65aa8004a3bf8668d0168adba81f0a2c131b19ac0fe09d035b8994e90e99821
hovercard-subject-tagissue:3475412059
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/17845/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2146240476d4be17c6e83b0e478b9bff0d13a8badb8ddc857281c7345a1863f8/getsentry/sentry-javascript/issues/17845
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2146240476d4be17c6e83b0e478b9bff0d13a8badb8ddc857281c7345a1863f8/getsentry/sentry-javascript/issues/17845
og:image:altIs there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezandt-square
hostnamegithub.com
expected-hostnamegithub.com
Nonef3851aad500d8e8dce736722ddc6fa9596e17d9fce3c53581eba968664c0bc32
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee29c922455fd8137f27e1cfcdf6a1e8b920b1926
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/17845#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F17845
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F17845
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17845
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17845
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17845
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues334 (334)https://github.com/getsentry/sentry-javascript/issues
Pull requests51 (51)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17845
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17845
#17847https://github.com/getsentry/sentry-javascript/pull/17847
Baggage header propagation is dropping property valueshttps://github.com/getsentry/sentry-javascript/issues/17845#top
#17847https://github.com/getsentry/sentry-javascript/pull/17847
https://github.com/chargome
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
https://github.com/zandt-square
zandt-squarehttps://github.com/zandt-square
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#issue-3475412059
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
w3c spechttps://www.w3.org/TR/baggage/#example
W3C baggage spechttps://www.w3.org/TR/baggage/
https://www.w3.org/TR/baggage/#propertyhttps://www.w3.org/TR/baggage/#property
https://github.com/w3c/baggage/blob/main/test/test_baggage.py#L151-L158https://github.com/w3c/baggage/blob/main/test/test_baggage.py#L151-L158
sentry-javascript/packages/core/src/utils/baggage.tshttps://github.com/getsentry/sentry-javascript/blob/379b539c4a113a68a75301906458770bc8ae7422/packages/core/src/utils/baggage.ts#L113-L133
379b539https://github.com/getsentry/sentry-javascript/commit/379b539c4a113a68a75301906458770bc8ae7422
zandt-squarehttps://github.com/zandt-square
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20045827689
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20045827867
https://github.com/apps/linear
linearhttps://github.com/apps/linear
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#issuecomment-3358423357
Linearhttps://linear.app
JS-1015https://linear.app/getsentry/issue/JS-1015/baggage-header-propagation-is-dropping-property-values
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20045828176
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845
github-actionshttps://github.com/apps/github-actions
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
on Oct 1, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20045830220
chargomehttps://github.com/chargome
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20053835381
https://github.com/chargome
chargomehttps://github.com/chargome
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845#issuecomment-3360261206
@zandt-squarehttps://github.com/zandt-square
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20055720391
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845
chargomehttps://github.com/chargome
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#17847https://github.com/getsentry/sentry-javascript/pull/17847
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20058572641
pullhttps://github.com/apps/pull
on Oct 2, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20064261933
fix(core): Keep all property values in baggage header (getsentry#17847)https://github.com/Stars1233/sentry-javascript/commit/51a9defbcf08a90fd1c4c395b9af89c478c53420
getsentry#17847https://github.com/getsentry/sentry-javascript/pull/17847
51a9defhttps://github.com/Stars1233/sentry-javascript/commit/51a9defbcf08a90fd1c4c395b9af89c478c53420
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Oct 7, 2025https://github.com/getsentry/sentry-javascript/issues/17845#issuecomment-3376450525
GitHub Actionshttps://help.github.com/en/actions
#17847https://github.com/getsentry/sentry-javascript/pull/17847
10.18.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/10.18.0
andreiborzahttps://github.com/andreiborza
on Oct 15, 2025https://github.com/getsentry/sentry-javascript/issues/17845#event-20289792735
fix(core): Keep all property values in baggage header (getsentry#17847)https://github.com/thedanchez/sentry-javascript/commit/32edbd0950042e06f6bdc0737b7f1fef2854e2cf
getsentry#17847https://github.com/getsentry/sentry-javascript/pull/17847
32edbd0https://github.com/thedanchez/sentry-javascript/commit/32edbd0950042e06f6bdc0737b7f1fef2854e2cf
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/17845
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17845
chargomehttps://github.com/chargome
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.