mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Allow float values for HTTPRequest.timeout (#16442)
This commit is contained in:
@@ -39,8 +39,9 @@ void ModApiHttp::read_http_fetch_request(lua_State *L, HTTPFetchRequest &req)
|
|||||||
getstringfield(L, 1, "url", req.url);
|
getstringfield(L, 1, "url", req.url);
|
||||||
getstringfield(L, 1, "user_agent", req.useragent);
|
getstringfield(L, 1, "user_agent", req.useragent);
|
||||||
req.multipart = getboolfield_default(L, 1, "multipart", false);
|
req.multipart = getboolfield_default(L, 1, "multipart", false);
|
||||||
if (getintfield(L, 1, "timeout", req.timeout))
|
float timeout_sec = 0;
|
||||||
req.timeout *= 1000;
|
if (getfloatfield(L, 1, "timeout", timeout_sec))
|
||||||
|
req.timeout = timeout_sec * 1000;
|
||||||
|
|
||||||
lua_getfield(L, 1, "method");
|
lua_getfield(L, 1, "method");
|
||||||
if (lua_isstring(L, -1))
|
if (lua_isstring(L, -1))
|
||||||
|
Reference in New Issue
Block a user