Method
__call__
(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
Tested by
no test coverage detected