MCPcopy
hub / github.com/mitmproxy/mitmproxy / check

Method check

mitmproxy/addons/clientplayback.py:196–210  ·  view source on GitHub ↗
(self, f: flow.Flow)

Source from the content-addressed store, hash-verified

194 self.inflight = None
195
196 def check(self, f: flow.Flow) -> str | None:
197 if f.live or f == self.inflight:
198 return "Can't replay live flow."
199 if f.intercepted:
200 return "Can't replay intercepted flow."
201 if isinstance(f, http.HTTPFlow):
202 if not f.request:
203 return "Can't replay flow with missing request."
204 if f.request.raw_content is None:
205 return "Can't replay flow with missing content."
206 if f.websocket is not None:
207 return "Can't replay WebSocket flows."
208 else:
209 return "Can only replay HTTP flows."
210 return None
211
212 def load(self, loader):
213 loader.add_option(

Callers 10

test_checkFunction · 0.95
start_replayMethod · 0.95
test_save_staticFunction · 0.80
test_save_filter_helpFunction · 0.80
test_save_settingsFunction · 0.80
test_save_flowsFunction · 0.80
test_save_flows_contentFunction · 0.80
test_static_viewerFunction · 0.80
test_check_argsFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 8

test_checkFunction · 0.76
test_save_staticFunction · 0.64
test_save_filter_helpFunction · 0.64
test_save_settingsFunction · 0.64
test_save_flowsFunction · 0.64
test_save_flows_contentFunction · 0.64
test_static_viewerFunction · 0.64
test_check_argsFunction · 0.64