diff --git a/src/logic/scripting/lua/libs/libnetwork.cpp b/src/logic/scripting/lua/libs/libnetwork.cpp index d8c9e7c98..577eee7a9 100644 --- a/src/logic/scripting/lua/libs/libnetwork.cpp +++ b/src/logic/scripting/lua/libs/libnetwork.cpp @@ -109,6 +109,10 @@ static int l_request(lua::State* L, network::Network& network) { request.followLocation = lua::toboolean(L, -1); lua::pop(L); } + if (lua::getfield(L, "timeout_ms", 2)) { + request.timeoutMs = lua::tointeger(L, -1); + lua::pop(L); + } int currentRequestId = request_id++; request.onResponse = [currentRequestId](std::vector bytes) {