Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(falcon): Don't exhaust request body stream #3768

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

szokeasaurusrex
Copy link
Member

Only read the cached request._media, since reading request.media will exhaust the request.bounded_stream if it has not been read before. Note that this means that we will now only send the JSON request body to Sentry if the Falcon request handler reads the JSON data.

Fixes #3761

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.87%. Comparing base (3e28853) to head (83334b7).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3768      +/-   ##
==========================================
- Coverage   79.90%   79.87%   -0.04%     
==========================================
  Files         137      137              
  Lines       15373    15373              
  Branches     2608     2609       +1     
==========================================
- Hits        12284    12279       -5     
- Misses       2221     2223       +2     
- Partials      868      871       +3     
Files with missing lines Coverage Δ
sentry_sdk/integrations/falcon.py 85.49% <100.00%> (ø)

... and 3 files with indirect coverage changes

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-falcon branch from 87cf66e to da1b4fd Compare November 13, 2024 12:40
@szokeasaurusrex szokeasaurusrex enabled auto-merge (squash) November 13, 2024 12:41
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-falcon branch 3 times, most recently from 68e1839 to 80164b7 Compare November 13, 2024 13:33
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-falcon branch from 80164b7 to 29cff89 Compare November 13, 2024 13:37
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

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

Looks good!

@antonpirker antonpirker enabled auto-merge (squash) November 21, 2024 10:19
@antonpirker antonpirker merged commit aa6e8fd into master Nov 21, 2024
136 checks passed
@antonpirker antonpirker deleted the szokeasaurusrex/fix-falcon branch November 21, 2024 10:32
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.

request.bounded_stream is consumed
2 participants