fiddlercontent-encoding

How to decode response with zlib in fiddler


I know there is Response body is encoded. Click to decode but it dosen't work.

The response I get is encoded by zlib not gzip and there is no Content-Encoding: gzip in response header.

Now I can save the response body to a file and then decode it by Python, but I really want to see the pretty content just in fiddler.

What should I do?


Solution

  • I don't have enough rep. to comment, but I improved PaleNeutron's snippet.

    In the FiddlerScript tab:

    public static ContextAction("Force Decode (zlib)")
    function AddEncoding(oSessions: Fiddler.Session[]){
        for (var x:int = 0; x < oSessions.Length; x++){
            if (oSessions[x].oRequest.headers["Content-Encoding"]=="zlib"){
                oSessions[x].oRequest.headers["Content-Encoding"]="deflate";
                oSessions[x].utilDecodeRequest();
            }
            if (oSessions[x].oResponse.headers["Content-Encoding"]=="zlib"){
                oSessions[x].oResponse.headers["Content-Encoding"]="deflate";
                oSessions[x].utilDecodeResponse();
            }
        }
        UI.actUpdateInspector(true,true);
    }