diff --git a/apisix/plugins/grpc-transcode/proto.lua b/apisix/plugins/grpc-transcode/proto.lua index 83b6f38b..9f828906 100644 --- a/apisix/plugins/grpc-transcode/proto.lua +++ b/apisix/plugins/grpc-transcode/proto.lua @@ -43,7 +43,12 @@ local function create_proto_obj(proto_id) end local _p = protoc.new() - local res = _p:load(content) + -- the loaded proto won't appears in _p.loaded without a file name after lua-protobuf=0.3.2, + -- which means _p.loaded after _p:load(content) is always empty, so we can pass a fake file + -- name to keep the code below unchanged, or we can create our own load function with returning + -- the loaded DescriptorProto table additionally, see more details in + -- https://github.com/apache/apisix/pull/4368 + local res = _p:load(content, "filename for loaded") if not res or not _p.loaded then return nil, "failed to load proto content" diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec index 62076107..f91ba686 100644 --- a/rockspec/apisix-master-0.rockspec +++ b/rockspec/apisix-master-0.rockspec @@ -45,7 +45,7 @@ dependencies = { "lua-resty-session = 2.24", "opentracing-openresty = 0.1", "lua-resty-radixtree = 2.8.0", - "lua-protobuf = 0.3.1", + "lua-protobuf = 0.3.2", "lua-resty-openidc = 1.7.2-1", "luafilesystem = 1.7.0-2", "lua-tinyyaml = 1.0",