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

Method modified_send

tests/test_routing.py:1004–1007  ·  tests/test_routing.py::WebsocketMiddleware.modified_send
(msg: Message)

Source from the content-addressed store, hash-verified

1002
1003 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
1004 async def modified_send(msg: Message) -> None:
1005 if msg[class="st">"type"] == class="st">"websocket.accept":
1006 msg[class="st">"headers"].append((bclass="st">"X-Test", bclass="st">"Set by middleware"))
1007 await send(msg)
1008
1009 await self.app(scope, receive, modified_send)
1010

Callers

nothing calls this directly

Calls 2

sendFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected