mod_rest/mod_rest.lua
changeset 3818 0dede5b0ab27
parent 3817 aa1ad69c7c10
child 3819 1a0a612d36bc
equal deleted inserted replaced
3817:aa1ad69c7c10 3818:0dede5b0ab27
   131 			module:log("debug", "Sending[rest]: %s", stanza:top_tag());
   131 			module:log("debug", "Sending[rest]: %s", stanza:top_tag());
   132 			response.headers.content_type = send_type;
   132 			response.headers.content_type = send_type;
   133 			response:send(encode(send_type, stanza));
   133 			response:send(encode(send_type, stanza));
   134 			return true;
   134 			return true;
   135 		end
   135 		end
   136 		if module:send(payload, origin) then
   136 		module:send(payload, origin);
   137 			return 202;
   137 		return 202;
   138 		else
       
   139 			return 500;
       
   140 		end
       
   141 	end
   138 	end
   142 end
   139 end
   143 
   140 
   144 -- Handle stanzas submitted via HTTP
   141 -- Handle stanzas submitted via HTTP
   145 module:depends("http");
   142 module:depends("http");