1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

HTTP API: Allow binary downloads and headers (#8573)

Add minetest.features.httpfetch_binary_data
This commit is contained in:
SmallJoker 2019-06-06 19:13:29 +02:00 committed by GitHub
parent 7379aa74cf
commit cb00632e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 15 deletions

View file

@ -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;
}