Skip to content

Commit 4f078be

Browse files
author
3kis
committed
revert addtional changes
1 parent 20c05d7 commit 4f078be

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

apisix/plugins/grpc-transcode/response.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-- (the "License"); you may not use this file except in compliance with
77
-- the License. You may obtain a copy of the License at
88
--
9-
-- http://www.apache.org/licenses/LICENSE-2.0
9+
-- http://www.apache.org/licenses/LICENSE-2.0
1010
--
1111
-- Unless required by applicable law or agreed to in writing, software
1212
-- distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,13 @@
1616
--
1717
local util = require("apisix.plugins.grpc-transcode.util")
1818
local grpc_proto = require("apisix.plugins.grpc-transcode.proto")
19-
local core = require("apisix.core")
20-
local pb = require("pb")
21-
local ngx = ngx
22-
local string = string
19+
local core = require("apisix.core")
20+
local pb = require("pb")
21+
local ngx = ngx
22+
local string = string
2323
local ngx_decode_base64 = ngx.decode_base64
24-
local ipairs = ipairs
25-
local pcall = pcall
24+
local ipairs = ipairs
25+
local pcall = pcall
2626
local type = type
2727
local pairs = pairs
2828
local setmetatable = setmetatable
@@ -48,11 +48,11 @@ local function fetch_proto_array_names(proto_obj)
4848
return names
4949
end
5050

51-
local function set_default_array(tab,array_names )
51+
local function set_default_array(tab, array_names)
5252
if type(tab) ~= "table" then
5353
return false
5454
end
55-
for k, v in pairs(tab) do
55+
for k, v in pairs(tab) do
5656
if type(v) == "table" then
5757
if array_names[k] == 1 then
5858
setmetatable(v,core.json.array_mt)
@@ -101,7 +101,7 @@ local function handle_error_response(status_detail_type, proto)
101101
pb.state(pb_old_state)
102102
if not ok then
103103
err_msg = "failed to call pb.decode to decode details in "
104-
.. "grpc-status-details-bin"
104+
.. "grpc-status-details-bin"
105105
ngx.arg[1] = err_msg
106106
return err_msg .. ", err: " .. err_or_value
107107
end
@@ -151,7 +151,7 @@ return function(ctx, proto, service, method, pb_option, show_status_in_body, sta
151151
local m = util.find_method(proto, service, method)
152152
if not m then
153153
return false, "2.Undefined service method: " .. service .. "/" .. method
154-
.. " end."
154+
.. " end."
155155
end
156156

157157
if not ngx.req.get_headers()["X-Grpc-Web"] then
@@ -170,8 +170,8 @@ return function(ctx, proto, service, method, pb_option, show_status_in_body, sta
170170
return err_msg
171171
end
172172

173-
local array_names = fetch_proto_array_names ( proto )
174-
set_default_array(decoded,array_names)
173+
local array_names = fetch_proto_array_names( proto )
174+
set_default_array(decoded, array_names)
175175

176176
local response, err = core.json.encode(decoded)
177177
if not response then

0 commit comments

Comments
 (0)