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

Method modified_send

tests/test_routing.py:949–952  ·  tests/test_routing.py::NamedMiddleware.modified_send
(msg: Message)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sendFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected