Skip to content

Conversation

@daniel-sanche
Copy link
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 as code owners 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 join this conversation on GitHub. Already have an account? Sign in to comment

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