Fix http.response.template being used with BaseHTTPMiddleware#473
Fix http.response.template being used with BaseHTTPMiddleware#473blueyed wants to merge 4 commits intoKludex:masterfrom
Conversation
|
@tomchristie |
|
Only style issues. Awaiting feedback before fixing this. It is not very helpful btw ;) (should show the diff)
|
Running |
e5efd01 to
c9b04ba
Compare
c9b04ba to
958d796
Compare
| raise RuntimeError("No response returned.") | ||
| assert message["type"] == "http.response.start" | ||
|
|
||
| if "http.response.template" in scope.get("extensions", {}): |
There was a problem hiding this comment.
This is always True (https://codecov.io/gh/blueyed/starlette/compare/ef49e73e1043fdf7ce409a190ab632cfd568953e...e3ec97fcb16de9f3bb645ddb67495349c124dbb2/diff#D4-50).
I.e. we should maybe test with a TestClient that does not use it?!
|
On reflection, the smarter thing for us to do in middleware would be to wait for the first body message, before figuring out if we should treat it as a streaming response, or a standard response. |
Fixes #472.