(self, response: Response)
| 181 | await self.send({"type": "websocket.close", "code": code, "reason": reason or ""}) |
| 182 | |
| 183 | async def send_denial_response(self, response: Response) -> None: |
| 184 | if "websocket.http.response" in self.scope.get("extensions", {}): |
| 185 | await response(self.scope, self.receive, self.send) |
| 186 | else: |
| 187 | raise RuntimeError("The server doesn't support the Websocket Denial Response extension.") |
| 188 | |
| 189 | |
| 190 | class WebSocketClose: |