Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

fix: django content length extraction bug#160

Merged
daniel-sanche merged 3 commits into
masterfrom
fix-django-httprequest
Jan 27, 2021
Merged

fix: django content length extraction bug#160
daniel-sanche merged 3 commits into
masterfrom
fix-django-httprequest

Conversation

@daniel-sanche
Copy link
Copy Markdown
Contributor

We recently added a feature to extract http_request data from Flask and Django environments. Django had a bug where multiple
logs originating from the same request would throw an exception, due to Django no allowing request.body access after an IO operation.

I updated the http_request content length code to use request.META instead of request.body, to match the other fields. I also added a test to make sure this django behaviour doesn't cause issues in the future

Fixes #159 🦕

@daniel-sanche daniel-sanche requested review from a team January 25, 2021 19:45
@product-auto-label product-auto-label Bot added the api: logging Issues related to the googleapis/python-logging API. label Jan 25, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 25, 2021
@daniel-sanche daniel-sanche merged commit 93eeaef into master Jan 27, 2021
@daniel-sanche daniel-sanche deleted the fix-django-httprequest branch January 27, 2021 00:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: logging Issues related to the googleapis/python-logging API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Django http_request inference can attempt to read request body more than once

2 participants