mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
HTTP API: Allow binary downloads and headers (#8573)
Add minetest.features.httpfetch_binary_data
This commit is contained in:
@@ -107,9 +107,10 @@ template <> v2f LuaHelper::readParam(lua_State *L, int index)
|
||||
|
||||
template <> std::string LuaHelper::readParam(lua_State *L, int index)
|
||||
{
|
||||
size_t length;
|
||||
std::string result;
|
||||
const char *str = luaL_checkstring(L, index);
|
||||
result.append(str);
|
||||
const char *str = luaL_checklstring(L, index, &length);
|
||||
result.assign(str, length);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user