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

Method __call__

tests/test_routing.py:948–954  ·  view source on GitHub ↗
(self, scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

946 self.name = name
947
948 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
949 async def modified_send(msg: Message) -> None:
950 if msg["type"] == "http.response.start":
951 msg["headers"].append((f"X-{self.name}".encode(), b"true"))
952 await send(msg)
953
954 await self.app(scope, receive, modified_send)
955
956 app = Starlette(
957 routes=[

Callers

nothing calls this directly

Calls 1

appMethod · 0.45

Tested by

no test coverage detected