From 20bbdbfa49982bd799ea904e7be3788c0e832049 Mon Sep 17 00:00:00 2001 From: neko259 Date: Wed, 16 Jan 2019 08:00:36 +0200 Subject: [PATCH] We don't need insecure environment to load a local file --- init.lua | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index ac1eb0a..527d024 100644 --- a/init.lua +++ b/init.lua @@ -16,24 +16,11 @@ local UPDATES_LIMIT = 10 local offset = 0 local http_in_progress = false -local ie, req_ie = _G, minetest.request_insecure_environment -if req_ie then ie = req_ie() end - -if not ie then - error("The mod requires access to insecure functions in order ".. - "to work. Please add the mod to your secure.trusted_mods ".. - "setting or disable the mod.") -end - -ie.package.path = ie.package.path - .. ";" .. modpath .. "/?.lua" - - -local JSON = ie.require("JSON") +local JSON = dofile(modpath .. "/JSON.lua") http_api = minetest.request_http_api() if not http_api then - error("HTTP API cannot be enabled.") + error("HTTP API cannot be enabled. Add the mods to trusted.") end local function make_request(method, request_body, callback)