Title: Undici 6.7.0 changes to request headers breaking Sentry code · Issue #10936 · getsentry/sentry-javascript · GitHub
Open Graph Title: Undici 6.7.0 changes to request headers breaking Sentry code · Issue #10936 · getsentry/sentry-javascript
X Title: Undici 6.7.0 changes to request headers breaking Sentry code · Issue #10936 · 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/10936
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Undici 6.7.0 changes to request headers breaking Sentry code","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which SDK are you using?\r\n\r\n@sentry/node\r\n\r\n### SDK Version\r\n\r\n7.105.0\r\n\r\n### Framework Version\r\n\r\n_No response_\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n_No response_\r\n\r\n### Steps to Reproduce\r\n\r\nI can't figure out how to reproduce it locally but the issue occurs immediately on our staging and production servers for some reason.\r\n\r\nI think it's related to undici@6.7.0 changes:\r\nhttps://github.com/nodejs/undici/pull/2708\r\nhttps://github.com/nodejs/undici/pull/2879\r\n\r\nand this line of code here:\r\nhttps://github.com/getsentry/sentry-javascript/blob/a8182713dd81caf5ccdbb521f1dd02e7fd3ab7a0/packages/node/src/integrations/undici/index.ts#L311\r\n\r\nSince the headers can now be arrays and iterables, this might not be properly accounting for that when attempting to call `.split()`.\r\n\r\nPinning to undici@6.6.2 does not exhibit this behavior.\r\n\r\n### Expected Result\r\n\r\nNo errors\r\n\r\n### Actual Result\r\n\r\n```\r\nTypeError: request.headers.split is not a function\r\n File \"/var/app/node_modules/@sentry/node/cjs/integrations/undici/index.js\", line 266, col 39, in setHeadersOnRequest\r\n const headerLines = request.headers.split('\\r\\n');\r\n File \"/var/app/node_modules/@sentry/node/cjs/integrations/undici/index.js\", line 177, col 7, in _onRequestCreate\r\n setHeadersOnRequest(request, sentryTraceHeader, sentryBaggageHeader);\r\n File \"node:diagnostics_channel\", line 142, col 9, in Channel.publish\r\n File \"/var/app/node_modules/undici/lib/core/request.js\", line 189, col 23, in new Request\r\n channels.create.publish({ request: this })\r\n File \"/var/app/node_modules/undici/lib/dispatcher/client.js\", line 294, col 21, in [dispatch]\r\n const request = new Request(origin, opts, handler)\r\n File \"/var/app/node_modules/undici/lib/interceptor/redirect-interceptor.js\", line 11, col 16, in Intercept\r\n return dispatch(opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 158, col 12, in [Intercepted Dispatch]\r\n return dispatch(opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 179, col 40, in Client.dispatch\r\n return this[kInterceptedDispatch](opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/pool-base.js\", line 143, col 28, in [dispatch]\r\n } else if (!dispatcher.dispatch(opts, handler)) {\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 150, col 29, in [Intercepted Dispatch]\r\n return this[kDispatch](opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 179, col 40, in Pool.dispatch\r\n return this[kInterceptedDispatch](opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/agent.js\", line 105, col 23, in [dispatch]\r\n return dispatcher.dispatch(opts, handler)\r\n File \"/var/app/node_modules/undici/lib/interceptor/redirect-interceptor.js\", line 11, col 16, in Intercept\r\n return dispatch(opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 158, col 12, in [Intercepted Dispatch]\r\n return dispatch(opts, handler)\r\n File \"/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js\", line 179, col 40, in Agent.dispatch\r\n return this[kInterceptedDispatch](opts, handler)\r\n File \"node:internal/deps/undici/undici\", line 10929, col 55, in \u003canonymous>\r\n```","author":{"url":"https://github.com/jessezhang91","@type":"Person","name":"jessezhang91"},"datePublished":"2024-03-05T17:27:57Z","url":"https://github.com/getsentry/sentry-javascript/issues/10936"}
| 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:a339e653-787a-8e4e-f5f4-6a6845df6334 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C838:1ADDB0:263F442:307529B:6B035851 |
| html-safe-nonce | 18ca18262c31e05a3ab8e97d073e0d04c434d28bf5ed94e47f832324fb9f4726 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODM4OjFBRERCMDoyNjNGNDQyOjMwNzUyOUI6NkIwMzU4NTEiLCJ2aXNpdG9yX2lkIjoiMTM0MDg0MjYzMzU5MzA1MTIxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e02d04bc607a8b8b40a78d496c6fd0637e270fb9d184479919de60e8b1362e4d |
| hovercard-subject-tag | issue:2169776878 |
| 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/10936/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9270deaa0c4607bab7e2b9c15c4e9233530afbcedf2d2083ac53a09b6f872b47/getsentry/sentry-javascript/issues/10936 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9270deaa0c4607bab7e2b9c15c4e9233530afbcedf2d2083ac53a09b6f872b47/getsentry/sentry-javascript/issues/10936 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jessezhang91 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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