Get raw (unzipped) HTML when export using mitmdump -w filename (zlib)

Hi all,

We know that mitmproxy have ability to decode gzip content in mitmproxy/netlib/encoding.py, the decode is using zlib.
When I try to export the flows to file withmitmdump -w filename, the file content is compressed and not readable. Is there a built-in way to get the unzipped content in exported file? Or is there a way to make zlib work on the file exporting process?

I am trying to figure out the same thing. Has this been resolved?

I would recommend using https://github.com/mitmproxy/mitmproxy/blob/master/examples/simple/io_read_dumpfile.py to read mitmproxy dumpfiles. mitmproxy’s flow.response.content is automatically gzip-decoded (see http://docs.mitmproxy.org/en/stable/scripting/api.html). If you want to avoid encodings at all, you could also pass --anticomp when recording. Does that help? :slight_smile: