alibaba / alibaba/anyproxy

gzip 压缩的请求 body 乱码

Open
#545 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

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 乱码
![图片](https://user-images.githubusercontent.com/6478615/75243151-52c55900-5804-11ea-9b48-1e47dc648efc.png)

Charles 虽然也有部分乱码,但关键信息可以看到
![图片](https://user-images.githubusercontent.com/6478615/75243196-62dd3880-5804-11ea-859d-caacbbf08f04.png)

应该是因为请求头里有 `Content-Encoding :
gzip`,在规则文件里解压后输出到控制台的内容就和 Charles 一样了,请教一下怎么处理才能在UI界面正常显示
```javascript
* beforeSendRequest(requestDetail) {
zlib.gunzip(requestDetail.requestData, function (error, result) {
if (error) throw error
console.log(result)
console.log(result.toString())
})
return newRequest
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the beforeSendRequest rule and its zlib.gunzip example, then trace how the gzip-encoded request body is passed to the UI. Compare the displayed body with the decoded output for the reported Bilibili request. Done means the UI shows readable content for gzip-compressed request bodies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.