Commit a08cae2
authored
fix(node): Ensure adding sentry-trace and baggage headers via SentryHttpInstrumentation doesn't crash (#16473)
On Node > 22.10.0, when spans are off, the `SentryHttpInstrumentation`
attempts adding `sentry-trace` and `baggage` headers to requests. Due to
race-conditions, this can error in cases where the request was already
sent/finished prior to setting the headers.
This fix prevents this by wrapping the logic in a try/catch.
Fixes: #164381 parent ac22be2 commit a08cae2
File tree
1 file changed
+23
-3
lines changed- packages/node/src/integrations/http
1 file changed
+23
-3
lines changedLines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
265 | | - | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
273 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
274 | 294 | | |
275 | 295 | | |
276 | 296 | | |
| |||
0 commit comments