mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Don't let HTTP API pass through untrusted function
This has been a problem since the first day, oops.
This commit is contained in:
parent
8472141b79
commit
8c99f2232b
4 changed files with 27 additions and 6 deletions
|
@ -250,7 +250,7 @@ end
|
|||
|
||||
-- HTTP callback interface
|
||||
|
||||
function core.http_add_fetch(httpenv)
|
||||
core.set_http_api_lua(function(httpenv)
|
||||
httpenv.fetch = function(req, callback)
|
||||
local handle = httpenv.fetch_async(req)
|
||||
|
||||
|
@ -266,7 +266,8 @@ function core.http_add_fetch(httpenv)
|
|||
end
|
||||
|
||||
return httpenv
|
||||
end
|
||||
end)
|
||||
core.set_http_api_lua = nil
|
||||
|
||||
|
||||
function core.close_formspec(player_name, formname)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue