Skip to content

Commit fa88d92

Browse files
authored
fix(httpx): Correctly append baggage in async client (#5530)
### Description Use the same helper function as we do in the sync client. The helper function makes sure that we avoid duplicating sentry items in the baggage. Came up in #5317 (review) #### Issues <!-- * resolves: #1234 * resolves: LIN-1234 --> #### Reminders - Please add tests to validate your changes, and lint your code using `tox -e linters`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
1 parent 65e0022 commit fa88d92

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sentry_sdk/integrations/httpx.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,8 @@ async def send(
135135
key=key, value=value, url=request.url
136136
)
137137
)
138-
if key == BAGGAGE_HEADER_NAME and request.headers.get(
139-
BAGGAGE_HEADER_NAME
140-
):
141-
# do not overwrite any existing baggage, just append to it
142-
request.headers[key] += "," + value
138+
if key == BAGGAGE_HEADER_NAME:
139+
add_sentry_baggage_to_headers(request.headers, value)
143140
else:
144141
request.headers[key] = value
145142

0 commit comments

Comments
 (0)