-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix http.response.template being used with BaseHTTPMiddleware #473
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.