Permalink
Browse files

Merge pull request #19 from ignacio/patch-2

Set querystring also for POST requests
  • Loading branch information...
mascarenhas committed Sep 24, 2013
2 parents bb69bde + 6515db0 commit de611a0c3b21fba3c3b0f5247d8a1af5f80ac6dc
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/wsapi/mock.lua
View
@@ -118,6 +118,12 @@ local function build_post(path, params, headers)
req.CONTENT_TYPE = "x-www-form-urlencoded"
end
-- if the path includes a query string, store it in the appropiate header
local qs = path:match("?(.+)$")
if qs then
req.QUERY_STRING = qs
end
req.CONTENT_LENGTH = #body
return {
@@ -155,4 +161,4 @@ function _M.make_handler(app)
}
end
return _M
return _M

0 comments on commit de611a0

Please sign in to comment.