File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
sentry_sdk/integrations/celery Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -231,11 +231,11 @@ def _update_celery_task_headers(
231231 if key .startswith ("sentry-" ):
232232 updated_headers ["headers" ][key ] = value
233233
234- # Preserve user-provided custom headers in the inner "headers" dict
235- # so they survive to task.request.headers on the worker (celery#4875).
236- for key , value in original_headers .items ():
237- if key != "headers" and key not in updated_headers [ "headers" ] :
238- updated_headers [ "headers" ][ key ] = value
234+ # Preserve user-provided custom headers in the inner "headers" dict
235+ # so they survive to task.request.headers on the worker (celery#4875).
236+ for key , value in original_headers .items ():
237+ if key != "headers" :
238+ updated_headers . setdefault ( "headers" , {}). setdefault ( key , value )
239239
240240 return updated_headers
241241
You can’t perform that action at this time.
0 commit comments