-
Notifications
You must be signed in to change notification settings - Fork 514
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
Make reading the request body work in Django ASGI apps. #2495
Conversation
…try/sentry-python into antonpirker/django_asgi_read_body
As I was working on the django 5 update I found out that we're not running the asgi django test suite on any version of django 4, because we don't install Basically this is missing from tox.ini: 96a4d46 But when I added it, the asgi test suite was failing for django 4. Maybe also because of the issue you fixed here? We should fix that. Not necessarily in this PR, but it might be that the test case you added was actually never executed for django 4. |
Created a separate issue for the asgi tests: #2498 @szokeasaurusrex is taking a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Co-authored by Daniel Szoke <[email protected]>
Handle request body in ASGI based Django apps. Starting with Django 4.1 the stream representing the request body is closed immediately preventing us from reading it. This fix reads the request body early on, so it is cached by Django and can be then read by our integration to add to the events sent to Sentry.
Fixes #2375