flomesh-io / pipy

Pipy is a programmable proxy for the cloud, edge and IoT.
https://flomesh.io/pipy
Other
743 stars 70 forks source link

内置的Dataformat能不能加入gzip 等解压缩工具 #109

Closed chungang-li closed 1 year ago

chungang-li commented 1 year ago

Feature Request

1.我们又很多业务场景都是body都是压缩上传,pipy无法解码

pajama-coder commented 1 year ago

如果是 HTTP 请求,可以通过 decompressHTTP() 来解压缩。如果要解压缩一般数据,可以把要解压的数据包在 MessageStart 和 MessageEnd 中间,然后通过 decompressMessage() 来解压缩。

keveinliu commented 1 year ago

可以参考一下decompressHTTP()的文档,这个filter会根据header来判断是否需要解压: https://flomesh.io/docs/en/reference/api/Configuration/decompressHTTP

This filter checks head.headers['content-encoding'] of the input MessageStart event. If its value is either of "gzip" or "br", the message body will be decompressed in the output.

chungang-li commented 1 year ago

thanks