Skip to content

Work with a copy of request, vars in the event#2125

Merged
sentrivana merged 7 commits intomasterfrom
ivana/dont-modify-refs
May 22, 2023
Merged

Work with a copy of request, vars in the event#2125
sentrivana merged 7 commits intomasterfrom
ivana/dont-modify-refs

Conversation

@sentrivana
Copy link
Contributor

@sentrivana sentrivana commented May 19, 2023

In some cases we were attaching parts of the original request to the event with live references on them and ending up modifying the underlying headers or request data when we scrubbed the event. Now we make sure to only attach a copy of the request to the event. We also do the same for frame vars.

See:

@sentrivana sentrivana force-pushed the ivana/dont-modify-refs branch from 22e3613 to 8800e2c Compare May 19, 2023 13:29
In some cases we were attaching parts of the original
request to the event with live references in them and
ending up modifying the underlying headers or request
data when we scrubbed the event. Now we make sure to
only attach a copy of the request to the event. We also
do the same for frame vars.
@sentrivana sentrivana force-pushed the ivana/dont-modify-refs branch from 8800e2c to 6061def Compare May 19, 2023 13:30
@sentrivana sentrivana marked this pull request as ready for review May 19, 2023 13:44
@sentrivana sentrivana requested a review from sl0thentr0py May 22, 2023 07:35
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to do this in all of these

➜  sentry-python git:(master) rg 'event.*"request".*=' sentry_sdk
sentry_sdk/integrations/gcp.py
196:        event["request"] = request

sentry_sdk/integrations/asgi.py
214:        event["request"] = request_info

sentry_sdk/integrations/_wsgi_common.py
80:        event["request"] = request_info

sentry_sdk/integrations/aws_lambda.py
383:        sentry_event["request"] = request

sentry_sdk/integrations/fastapi.py
119:                        event["request"] = request_info

sentry_sdk/integrations/starlette.py
392:                            event["request"] = request_info
438:                            event["request"] = request_info

@sentrivana sentrivana requested a review from sl0thentr0py May 22, 2023 13:06
@sentrivana sentrivana merged commit 443b7b9 into master May 22, 2023
@sentrivana sentrivana deleted the ivana/dont-modify-refs branch May 22, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants