Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果service端是Gzip压缩后的响应,请求的客服端解析报错gzip: invalid header。然而如果不通过gateway网关方式,直接用客户端,请求服务端,没事儿。 #18

Closed
xiaofengfeifei opened this issue Aug 26, 2020 · 2 comments
Assignees
Labels

Comments

@xiaofengfeifei
Copy link

No description provided.

@smallnest smallnest self-assigned this Aug 26, 2020
@smallnest smallnest added the bug label Aug 26, 2020
@xiaofengfeifei
Copy link
Author

xiaofengfeifei commented Aug 26, 2020

如果service端是Gzip压缩后的响应,请求的客服端解析报错gzip: invalid header!
然而如果不通过gateway网关方式,直接用客户端,请求服务端,没事儿。

查看网关源码得知,在client.input()的方法中做的rpc到http响应的转换。
其中err = res.Decode(client.r),payload已经做过解压缩处理了,
但是call.Metadata, call.Reply, _ = convertRes2Raw(res)中,响应头依然设置成了gzip压缩
if res.CompressType() == protocol.Gzip {
m["Content-Encoding"] = "gzip"
}
是不是问题在这里?

@smallnest
Copy link
Member

good found.

就是这个问题, payload已经unzip了,没必要设置头了。 rpcx代码我修改了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants