MCPcopy
hub / github.com/mitmproxy/mitmproxy / write

Method write

mitmproxy/tools/web/app.py:292–298  ·  view source on GitHub ↗
(self, chunk: str | bytes | dict | list)

Source from the content-addressed store, hash-verified

290 raise tornado.httpclient.HTTPError(403)
291
292 def write(self, chunk: str | bytes | dict | list):
293 # Writing arrays on the top level is ok nowadays.
294 # http://flask.pocoo.org/docs/0.11/security/#json-security
295 if isinstance(chunk, list):
296 chunk = tornado.escape.json_encode(chunk)
297 self.set_header("Content-Type", "application/json; charset=UTF-8")
298 super().write(chunk)
299
300 def set_default_headers(self):
301 super().set_default_headers()

Callers 15

save_staticFunction · 0.45
save_flows_contentFunction · 0.45
getMethod · 0.45
getMethod · 0.45
getMethod · 0.45
postMethod · 0.45
getMethod · 0.45
getMethod · 0.45
getMethod · 0.45
postMethod · 0.45
getMethod · 0.45
getMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected