MCPcopy Create free account
hub / github.com/encode/starlette / StaticResponseApp

Class StaticResponseApp

benchmarks/gzip_benchmark.py:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46class StaticResponseApp:
47 def __init__(self, messages: tuple[Message, ...]) -> None:
48 self.messages = messages
49
50 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
51 for message in self.messages:
52 outgoing_message = dict(message)
53 if "headers" in outgoing_message:
54 outgoing_message["headers"] = list(outgoing_message["headers"])
55 await send(outgoing_message)
56
57
58@dataclass

Callers 3

test_gzipFunction · 0.85
test_gzip_bypassFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_gzipFunction · 0.68
test_gzip_bypassFunction · 0.68