Giter Site home page Giter Site logo

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

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

from rpcx-gateway.

Comments (2)

xiaofengfeifei avatar xiaofengfeifei commented on May 27, 2024

如果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"
}
是不是问题在这里?

from rpcx-gateway.

smallnest avatar smallnest commented on May 27, 2024

good found.

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

from rpcx-gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.