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

Method __call__

starlette/middleware/gzip.py:17–29  ·  starlette/middleware/gzip.py::GZipMiddleware.__call__
(self, scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

15 self.compresslevel = compresslevel
16
17 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
18 if scope[class="st">"type"] != class="st">"http": class="cm"># pragma: no cover
19 await self.app(scope, receive, send)
20 return
21
22 headers = Headers(scope=scope)
23 responder: ASGIApp
24 if class="st">"gzip" in headers.get(class="st">"Accept-Encoding", class="st">""):
25 responder = GZipResponder(self.app, self.minimum_size, compresslevel=self.compresslevel)
26 else:
27 responder = IdentityResponder(self.app, self.minimum_size)
28
29 await responder(scope, receive, send)
30
31
32class IdentityResponder:

Callers

nothing calls this directly

Calls 5

HeadersClass · 0.90
GZipResponderClass · 0.85
IdentityResponderClass · 0.85
appMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected