Handle case when headers argument of ResponseStream constructor is None#2729
Conversation
Noneheaders argument of ResponseStream constructor is None
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2729 +/- ##
=============================================
- Coverage 88.981% 88.884% -0.098%
=============================================
Files 92 92
Lines 6979 6981 +2
Branches 1190 1191 +1
=============================================
- Hits 6210 6205 -5
- Misses 527 531 +4
- Partials 242 245 +3
☔ View full report in Codecov by Sentry. |
ahopkins
left a comment
There was a problem hiding this comment.
Can you add some unit tests?
|
@ahopkins I've added a test, which was failing prior to my fix and is now passing. I've probably put it in the wrong place, so let me know if you want me to move it. |
|
It's a long file, but I'd dump it here: https://github.com/sanic-org/sanic/blob/main/tests/test_response.py |
|
In case you missed it, I moved the test to |
|
ResponseStream is not stream,bug? |
Sorry, I don't understand your question. |
The default value for the
headersargument isNone. This leads to an Exception whenheadersis passed to theHeaderconstructor, which is expecting a Mapping type.