MCPcopy
hub / github.com/pyload/pyload / __call__

Method __call__

module/web/middlewares.py:46–57  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

44 self.compress_level = int(compress_level)
45
46 def __call__(self, environ, start_response):
47 if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING', ''):
48 # nothing for us to do, so this middleware will
49 # be a no-op:
50 return self.application(environ, start_response)
51 response = GzipResponse(start_response, self.compress_level)
52 app_iter = self.application(environ,
53 response.gzip_start_response)
54 if app_iter is not None:
55 response.finish_response(app_iter)
56
57 return response.write()
58
59def header_value(headers, key):
60 for header, value in headers:

Callers

nothing calls this directly

Calls 4

finish_responseMethod · 0.95
writeMethod · 0.95
GzipResponseClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected