Skip to content

Conversation

@TimPansino
Copy link
Contributor

@TimPansino TimPansino commented Nov 13, 2025

Overview

When an ASGIWebTransaction consumes the headers from a http.response.start event, it was doing so without regard to the allowable input types. When the headers are a generator, the generator was consumed by the call to process_response() leaving no headers remaining for the web server to send.

This exact same bug was also present in ASGIBrowserMiddleware, and requires the same fix.

  • Fix this issue by consuming the generator into a list() object, preserving them. Then, pass this list to both process_response() and the web server.

Testing

Both bug fix commits are separated for ease of testing. Reverting the commit for either ASGIWebTransaction or ASGIBrowserMiddleware causes the included regression test to fail. This proves the issue can be caused by either wrapper and must be fixed in both.

@TimPansino TimPansino requested a review from a team as a code owner November 13, 2025 19:41
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.89s
✅ MARKDOWN markdownlint 7 0 0 0 1.29s
✅ PYTHON ruff 948 0 0 0 1.04s
✅ PYTHON ruff-format 948 0 0 0 0.33s
✅ YAML prettier 15 0 0 0 1.5s
✅ YAML v8r 15 0 0 5.88s
✅ YAML yamllint 15 0 0 0.7s

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing Tests failing in CI. label Nov 13, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.82%. Comparing base (f59f52c) to head (0c00bae).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1578   +/-   ##
=======================================
  Coverage   81.81%   81.82%           
=======================================
  Files         207      207           
  Lines       23965    23970    +5     
  Branches     3801     3803    +2     
=======================================
+ Hits        19608    19613    +5     
+ Misses       3090     3087    -3     
- Partials     1267     1270    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot removed the tests-failing Tests failing in CI. label Nov 17, 2025
@mergify mergify bot added the tests-failing Tests failing in CI. label Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests-failing Tests failing in CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants