MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / make_pipe

Method make_pipe

mitmproxy/proxy/layers/http/_http1.py:152–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150 yield from () # pragma: no cover
151
152 def make_pipe(self) -> layer.CommandGenerator[None]:
153 self.state = self.passthrough
154 if self.buf:
155 already_received = self.buf.maybe_extract_at_most(len(self.buf)) or b""
156 # Some clients send superfluous newlines after CONNECT, we want to eat those.
157 already_received = already_received.lstrip(b"\r\n")
158 if already_received:
159 yield from self.state(events.DataReceived(self.conn, already_received))
160
161 def passthrough(self, event: events.Event) -> layer.CommandGenerator[None]:
162 assert self.stream_id

Callers 1

mark_doneMethod · 0.95

Calls 1

stateMethod · 0.45

Tested by

no test coverage detected