MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / echo_flow

Method echo_flow

mitmproxy/addons/dumper.py:255–278  ·  view source on GitHub ↗
(self, f: http.HTTPFlow)

Source from the content-addressed store, hash-verified

253 self.echo(f"{replay}{arrows} {http_version}{code} {reason} {size}")
254
255 def echo_flow(self, f: http.HTTPFlow) -> None:
256 if f.request:
257 self._echo_request_line(f)
258 if ctx.options.flow_detail >= 2:
259 self._echo_headers(f.request.headers)
260 if ctx.options.flow_detail >= 3:
261 self._echo_message(f.request, f)
262 if ctx.options.flow_detail >= 2:
263 self._echo_trailers(f.request.trailers)
264
265 if f.response:
266 self._echo_response_line(f)
267 if ctx.options.flow_detail >= 2:
268 self._echo_headers(f.response.headers)
269 if ctx.options.flow_detail >= 3:
270 self._echo_message(f.response, f)
271 if ctx.options.flow_detail >= 2:
272 self._echo_trailers(f.response.trailers)
273
274 if f.error:
275 msg = strutils.escape_control_characters(f.error.msg)
276 self.echo(f" << {msg}", bold=True, fg="red")
277
278 self.outfp.flush()
279
280 def match(self, f):
281 if ctx.options.flow_detail == 0:

Callers 4

test_echo_trailerFunction · 0.95
responseMethod · 0.95
errorMethod · 0.95
http_connect_errorMethod · 0.95

Calls 7

_echo_request_lineMethod · 0.95
_echo_headersMethod · 0.95
_echo_messageMethod · 0.95
_echo_trailersMethod · 0.95
_echo_response_lineMethod · 0.95
echoMethod · 0.95
flushMethod · 0.45

Tested by 1

test_echo_trailerFunction · 0.76