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

Function request

mitmproxy/proxy/server.py:546–555  ·  view source on GitHub ↗
(flow: http.HTTPFlow)

Source from the content-addressed store, hash-verified

544 nl.layer = layr
545
546 def request(flow: http.HTTPFlow):
547 if "cached" in flow.request.path:
548 flow.response = http.Response.make(418, f"(cached) {flow.request.text}")
549 if "toggle-tls" in flow.request.path:
550 if flow.request.url.startswith("https://"):
551 flow.request.url = flow.request.url.replace("https://", "http://")
552 else:
553 flow.request.url = flow.request.url.replace("http://", "https://")
554 if "redirect" in flow.request.path:
555 flow.request.host = "httpbin.org"
556
557 def tls_start_client(tls_start: tls.TlsData):
558 # INSECURE

Callers

nothing calls this directly

Calls 2

makeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…