| 248 | break |
| 249 | |
| 250 | async def stream_response(self, send: Send) -> None: |
| 251 | await send({"type": "http.response.start", "status": self.status_code, "headers": self.raw_headers}) |
| 252 | async for chunk in self.body_iterator: |
| 253 | if not isinstance(chunk, bytes | memoryview): |
| 254 | chunk = chunk.encode(self.charset) |
| 255 | await send({"type": "http.response.body", "body": chunk, "more_body": True}) |
| 256 | |
| 257 | await send({"type": "http.response.body", "body": b"", "more_body": False}) |
| 258 | |
| 259 | async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 260 | if scope["type"] == "websocket": |