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

Function wrapped_app

tests/middleware/test_base.py:1003–1010  ·  view source on GitHub ↗
(scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

1001
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
1012 return wrapped_app
1013

Callers

nothing calls this directly

Calls 1

appFunction · 0.70

Tested by

no test coverage detected