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

Function encode_gzip

mitmproxy/net/encoding.py:162–168  ·  view source on GitHub ↗
(content: bytes)

Source from the content-addressed store, hash-verified

160
161
162def encode_gzip(content: bytes) -> bytes:
163 s = BytesIO()
164 # set mtime to 0 so that gzip encoding is deterministic.
165 # Use compresslevel=1 for fastest compression speed.
166 with gzip.GzipFile(fileobj=s, mode="wb", mtime=0, compresslevel=1) as f:
167 f.write(content)
168 return s.getvalue()
169
170
171def decode_brotli(content: bytes) -> bytes:

Callers

nothing calls this directly

Calls 2

getvalueMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…