mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-31 18:31:04 +00:00
Allow float values for HTTPRequest.timeout (#16442)
This commit is contained in:
parent
3f0f7f4285
commit
7cbe62fe7b
1 changed files with 3 additions and 2 deletions
|
@ -39,8 +39,9 @@ void ModApiHttp::read_http_fetch_request(lua_State *L, HTTPFetchRequest &req)
|
|||
getstringfield(L, 1, "url", req.url);
|
||||
getstringfield(L, 1, "user_agent", req.useragent);
|
||||
req.multipart = getboolfield_default(L, 1, "multipart", false);
|
||||
if (getintfield(L, 1, "timeout", req.timeout))
|
||||
req.timeout *= 1000;
|
||||
float timeout_sec = 0;
|
||||
if (getfloatfield(L, 1, "timeout", timeout_sec))
|
||||
req.timeout = timeout_sec * 1000;
|
||||
|
||||
lua_getfield(L, 1, "method");
|
||||
if (lua_isstring(L, -1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue