moonbridge
changeset 174:d6db92e0f231
Ignore nil values in pairs(...) on GET and POST params
author | jbe |
---|---|
date | Wed Jun 17 23:50:28 2015 +0200 (2015-06-17) |
parents | 6e80bcf89bd5 |
children | 4cf337821a52 |
files | moonbridge_http.lua |
line diff
1.1 --- a/moonbridge_http.lua Wed Jun 17 20:29:44 2015 +0200 1.2 +++ b/moonbridge_http.lua Wed Jun 17 23:50:28 2015 +0200 1.3 @@ -100,11 +100,16 @@ 1.4 end 1.5 end 1.6 local function nextvalue(tbl, key) 1.7 - key = next(tbl, key) 1.8 - if key == nil then 1.9 - return nil 1.10 + while true do 1.11 + key = next(tbl, key) 1.12 + if key == nil then 1.13 + return nil 1.14 + end 1.15 + local value = tbl[key][1] 1.16 + if value ~= nil then 1.17 + return key, value 1.18 + end 1.19 end 1.20 - return key, tbl[key][1] 1.21 end 1.22 local params_list_metatable = { 1.23 __index = function(self, key)