newrelic / newrelic-python-agent

New Relic Python Agent
https://docs.newrelic.com/docs/agents/python-agent
Apache License 2.0
178 stars 102 forks source link

Fix bug in ASGI when no content-length header #1160

Closed hmstepanek closed 5 months ago

hmstepanek commented 5 months ago

Overview

Previously, if there was no content length header and browser injection was enabled, the ASGI wrapper would fail with a TypeError as the header_value would be None. Now, the except clause catches both type and value errors.

Fixes #1150.

github-actions[bot] commented 5 months ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 1 0 5.86s
✅ PYTHON black 2 0 0 1.17s
✅ PYTHON flake8 2 0 0.59s
✅ PYTHON isort 2 0 0 0.31s
✅ PYTHON pylint 2 0 5.05s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.59%. Comparing base (45b575f) to head (52a452a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1160 +/- ## ========================================== - Coverage 81.66% 81.59% -0.07% ========================================== Files 195 195 Lines 21643 21643 Branches 3779 3779 ========================================== - Hits 17674 17659 -15 - Misses 2871 2881 +10 - Partials 1098 1103 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.