(self, send: Send)
| 152 | ) |
| 153 | |
| 154 | def _wrap_websocket_denial_send(self, send: Send) -> Send: |
| 155 | async def wrapped(message: Message) -> None: |
| 156 | message_type = message["type"] |
| 157 | if message_type in {"http.response.start", "http.response.body"}: # pragma: no branch |
| 158 | message = {**message, "type": "websocket." + message_type} |
| 159 | await send(message) |
| 160 | |
| 161 | return wrapped |
| 162 | |
| 163 | async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: |
| 164 | if scope["type"] == "websocket": |