Skip to content

Commit

Permalink
fix(helpers) resolve linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Jun 27, 2016
1 parent cedabc3 commit 4ff9353
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ lint:
--std 'ngx_lua+busted' \
--globals '_KONG' \
--globals 'ngx' \
--globals 'assert' \
--no-redefined \
--no-unused-args

Expand Down
5 changes: 2 additions & 3 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ end

--- returns a pre-configured `http_client` for the Kong admin port.
-- @name admin_client
admin_client = function()
local admin_client = function()
return http_client(conf.admin_ip, conf.admin_port)
end

Expand Down Expand Up @@ -251,8 +251,7 @@ local function modifier_request(state, arguments, level)
local res = arguments[1]
assert(type(res) == "table", "Expected a http response object, got '"..tostring(res).."'. "..generic)
assert(type(res.read_body) == "function", "Expected a http response object with a 'read_body' function. "..generic)
local body, err = res:read_body()
body, err = cjson.decode(body)
local body, err = cjson.decode(assert(res:read_body()))
assert(body, "Expected the http response object to have a json encoded body, but decoding gave error '"..tostring(err).."'. "..generic)
kong_state.kong_request = body
kong_state.kong_response = nil
Expand Down

0 comments on commit 4ff9353

Please sign in to comment.