MCPcopy
hub / github.com/encode/starlette / _wrap_websocket_denial_send

Method _wrap_websocket_denial_send

starlette/responses.py:154–161  ·  view source on GitHub ↗
(self, send: Send)

Source from the content-addressed store, hash-verified

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":

Callers 3

__call__Method · 0.95
__call__Method · 0.80
__call__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected