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

Method send_denial_response

starlette/websockets.py:183–187  ·  view source on GitHub ↗
(self, response: Response)

Source from the content-addressed store, hash-verified

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
190class WebSocketClose:

Callers 1

appFunction · 0.95

Calls 1

getMethod · 0.45

Tested by 1

appFunction · 0.76