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

Function wrapped_receive

tests/middleware/test_base.py:1004–1008  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1002 def modifying_middleware(app: ASGIApp) -> ASGIApp:
1003 async def wrapped_app(scope: Scope, receive: Receive, send: Send) -> None:
1004 async def wrapped_receive() -> Message:
1005 msg = await receive()
1006 if msg["type"] == "http.request": # pragma: no branch
1007 msg["body"] = msg["body"] * 2
1008 return msg
1009
1010 await app(scope, wrapped_receive, send)
1011

Callers

nothing calls this directly

Calls 1

receiveFunction · 0.70

Tested by

no test coverage detected