Skip to content

gzip 压缩的请求 body 乱码 #545

@sanlengjingvv

Description

@sanlengjingvv

Plese fill the template when you reporting a new issue, thanks!

Which platform are you running AnyProxy

Mac

The version of the AnyProxy

4.1.2

Your expected behavior of AnyProxy

哔哩哔哩App,可以查看 https://dataflow.biliapi.com/log/pbmobile/unrealtime?ios 的请求 body

The actual behavior of AnyProxy

https://dataflow.biliapi.com/log/pbmobile/unrealtime?ios 的请求 body 乱码
图片

Charles 虽然也有部分乱码,但关键信息可以看到
图片

应该是因为请求头里有 Content-Encoding : gzip,在规则文件里解压后输出到控制台的内容就和 Charles 一样了,请教一下怎么处理才能在UI界面正常显示

* beforeSendRequest(requestDetail) {
    zlib.gunzip(requestDetail.requestData, function (error, result) {
        if (error) throw error
        console.log(result)
        console.log(result.toString())
    })
    return newRequest
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions