-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle case when headers
argument of ResponseStream
constructor is None
#2729
Conversation
None
headers
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
headers
argument isNone
. This leads to an Exception whenheaders
is passed to theHeader
constructor, which is expecting a Mapping type.