changeset 3814:0dede5b0ab27

mod_rest: Fix return status when sending and forgetting Turns out module:send() doesn't return anything, so there's no way to know if it was routed successfully.
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 16:35:55 +0100
parents aa1ad69c7c10
children 1a0a612d36bc
files mod_rest/mod_rest.lua
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Wed Jan 01 16:21:28 2020 +0100
+++ b/mod_rest/mod_rest.lua	Wed Jan 01 16:35:55 2020 +0100
@@ -133,11 +133,8 @@
 			response:send(encode(send_type, stanza));
 			return true;
 		end
-		if module:send(payload, origin) then
-			return 202;
-		else
-			return 500;
-		end
+		module:send(payload, origin);
+		return 202;
 	end
 end