login

<     >

2023-07-23 12:16:13 (UTC-03:00)

Marcel Rodrigues <marcelgmr@gmail.com>

ignore query substrings not containing '='

before this change, the request /?foo would crash the server

diff --git a/lib/ludweb/http.lua b/lib/ludweb/http.lua
index 1e8d4b4..f17b108 100644
--- a/lib/ludweb/http.lua
+++ b/lib/ludweb/http.lua
@@ -5,7 +5,9 @@ local function parse_query(query_str)
     if #query_str > 0 then
         for pair in (query_str.."&"):gmatch("([^&]*)&") do
             local key, val = pair:match("([^=]*)=(.*)")
-            query[key] = val
+            if key ~= nil then
+                query[key] = val
+            end
         end
     end
     return query