From dad67db83500fcc373373936a1fafa26fdc78f3a Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 14 Sep 2026 19:51:05 +0300 Subject: [PATCH] feat: Bytearray request body support --- src/logic/scripting/lua/libs/libnetwork.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/logic/scripting/lua/libs/libnetwork.cpp b/src/logic/scripting/lua/libs/libnetwork.cpp index fbd722b1d..59d50f075 100644 --- a/src/logic/scripting/lua/libs/libnetwork.cpp +++ b/src/logic/scripting/lua/libs/libnetwork.cpp @@ -102,7 +102,11 @@ static int l_request(lua::State* L, network::Network& network) { lua::pop(L); } if (lua::getfield(L, "body", 2)) { - request.body = lua::require_lstring(L, -1); + if (lua::type(L, -1) == LUA_TCDATA) { + request.body = lua::bytearray_as_string(L, -1); + } else { + request.body = lua::require_lstring(L, -1); + } lua::pop(L); } if (lua::getfield(L, "follow_location", 2)) {