Skip to content

Commit

Permalink
tests(aws-lambda) ensure JSON arrays are re-encoded as such
Browse files Browse the repository at this point in the history
  • Loading branch information
kidd authored and thibaultcha committed Sep 27, 2018
1 parent 340dee7 commit 6cc71e5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/03-plugins/23-aws-lambda/01-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,19 @@ for _, strategy in helpers.each_strategy() do
assert.is_string(res.headers["x-amzn-RequestId"])
assert.equal("some_value_json1", body.key1)
end)
it("passes empty json arrays unmodified", function()
local res = assert(proxy_client:send {
method = "POST",
path = "/post",
headers = {
["Host"] = "lambda.com",
["Content-Type"] = "application/json"
},
body = '[{}, []]'
})
assert.res_status(200, res)
assert.equal('[{},[]]', string.gsub(res:read_body(), "\n",""))
end)
it("invokes a Lambda function with POST and both querystring and body params", function()
local res = assert(proxy_client:send {
method = "POST",
Expand Down

0 comments on commit 6cc71e5

Please sign in to comment.