Fix undeclared req

This commit is contained in:
Pascal Engélibert 2022-02-21 12:34:19 +01:00
parent 26da26f7a6
commit 945e0c5820
Signed by: tuxmain
GPG Key ID: 3504BC6D362F7DCA
1 changed files with 3 additions and 2 deletions

View File

@ -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)