From 945e0c5820b22eeaffdfc9e817dcecbd6a269731 Mon Sep 17 00:00:00 2001 From: tuxmain Date: Mon, 21 Feb 2022 12:34:19 +0100 Subject: [PATCH] Fix undeclared req --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index ea8bc52..586a12c 100644 --- a/init.lua +++ b/init.lua @@ -136,10 +136,11 @@ function MatrixChat:send(msg) local u = self.server .."/_matrix/client/r0/rooms/".. self.room .."/send/m.room.message/" .. txid -- ?access_token=..token local h = {"Content-Type: application/json", "Authorization: Bearer " .. self.token} local d = minetest.write_json({msgtype="m.text", body=msg}) + local req if self.proxy then - local req = {url=u, method="POST", extra_headers=h, post_data=d} + req = {url=u, method="POST", extra_headers=h, post_data=d} else - local req = {url=u, method="PUT", extra_headers=h, data=d} + req = {url=u, method="PUT", extra_headers=h, data=d} end http.fetch(req, function(res)