# HG changeset patch # User jbe # Date 1434577828 -7200 # Node ID d6db92e0f2314da21313126ef0e146473109555b # Parent 6e80bcf89bd514ced7b15bb106c607c14d1d096f Ignore nil values in pairs(...) on GET and POST params diff -r 6e80bcf89bd5 -r d6db92e0f231 moonbridge_http.lua --- a/moonbridge_http.lua Wed Jun 17 20:29:44 2015 +0200 +++ b/moonbridge_http.lua Wed Jun 17 23:50:28 2015 +0200 @@ -100,11 +100,16 @@ end end local function nextvalue(tbl, key) - key = next(tbl, key) - if key == nil then - return nil + while true do + key = next(tbl, key) + if key == nil then + return nil + end + local value = tbl[key][1] + if value ~= nil then + return key, value + end end - return key, tbl[key][1] end local params_list_metatable = { __index = function(self, key)