Skip to content

Commit

Permalink
decode_json
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Sep 19, 2023
1 parent 0eb1f41 commit 750aec0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kong/plugins/grpc-gateway/deco.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local re_match = ngx.re.match
local re_gmatch = ngx.re.gmatch

local encode_json = cjson.encode
local decode_json = cjson.decode
local pcall = pcall

local deco = {}
Expand Down Expand Up @@ -226,7 +227,7 @@ function deco:upstream(body)
local body_variable = self.endpoint.body_variable
if body_variable then
if body and #body > 0 then
local body_decoded = cjson.decode(body)
local body_decoded = decode_json(body)
if body_variable ~= "*" then
--[[
// For HTTP methods that allow a request body, the `body` field
Expand Down

0 comments on commit 750aec0

Please sign in to comment.