From a471a0de1f4e817977eac28c0b04765b7909cd16 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 30 Dec 2023 16:03:45 -0500 Subject: [PATCH] Fix http.post using wrong argument as POST data --- src/lua/LuaHttp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua/LuaHttp.cpp b/src/lua/LuaHttp.cpp index e8dc6a245..7d07e53cc 100644 --- a/src/lua/LuaHttp.cpp +++ b/src/lua/LuaHttp.cpp @@ -250,12 +250,12 @@ static int http_request(lua_State *l, bool isPost) { postData = http::FormData{}; auto &formData = std::get(postData); - auto size = lua_objlen(l, headersIndex); + auto size = lua_objlen(l, 2); if (size) { for (auto i = 0U; i < size; ++i) { - lua_rawgeti(l, headersIndex, i + 1); + lua_rawgeti(l, 2, i + 1); if (!lua_istable(l, -1)) { luaL_error(l, "form item %i is not a table", i + 1);