Skip to content

Commit a6aec87

Browse files
authored
chore: avoid unwanted data (#193)
1 parent 9d73be3 commit a6aec87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/resty/etcd/v3.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,9 @@ end
10481048
function _grpc_M.grpc_call(self, serv, meth, attr, key, val, opts)
10491049
local conn = self.conn
10501050
attr.key = key
1051-
attr.value = serialize_grpc_value(self.serializer.serialize, val)
1051+
if val then
1052+
attr.value = serialize_grpc_value(self.serializer.serialize, val)
1053+
end
10521054

10531055
if opts then
10541056
self.call_opts.timeout = opts.timeout and opts.timeout * 1000
@@ -1304,6 +1306,7 @@ function _M.txn(self, compare, success, failure, opts)
13041306

13051307
if self.use_grpc then
13061308
rule.request_put = requestPut
1309+
rule.requestPut = nil
13071310
else
13081311
rule.requestPut = requestPut
13091312
end

0 commit comments

Comments
 (0)