MCPcopy Create free account
hub / github.com/StackStorm/st2 / __call__

Method __call__

st2common/st2common/middleware/streaming.py:27–46  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

25 self._path_whitelist = path_whitelist or []
26
27 def __call__(self, environ, start_response):
28 # Forces eventlet to respond immediately upon receiving a new chunk from endpoint rather
29 # than buffering it until the sufficient chunk size is reached. The order for this
30 # middleware is not important since it acts as pass-through.
31
32 matches = False
33 req_path = environ.get("PATH_INFO", None)
34
35 if not self._path_whitelist:
36 matches = True
37 else:
38 for path_whitelist in self._path_whitelist:
39 if fnmatch.fnmatch(req_path, path_whitelist):
40 matches = True
41 break
42
43 if matches:
44 environ["eventlet.minimum_write_chunk_size"] = 0
45
46 return self.app(environ, start_response)

Callers

nothing calls this directly

Calls 2

appMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected