Diff

mod_pubsub_post/mod_pubsub_post.lua @ 3255:64d1dfbd1740

mod_pubsub_post: Ensure actor is non-nil (catch inability to determine IP or simliar)
author Kim Alvefur <zash@zash.se>
date Fri, 24 Aug 2018 14:49:02 +0200
parent 3254:af73963cf1dd
child 3501:1df139b157fb
line wrap: on
line diff
--- a/mod_pubsub_post/mod_pubsub_post.lua	Fri Aug 24 14:48:59 2018 +0200
+++ b/mod_pubsub_post/mod_pubsub_post.lua	Fri Aug 24 14:49:02 2018 +0200
@@ -85,6 +85,10 @@
 		return 500;
 	end
 
+	if not actor then
+		return 401;
+	end
+
 	if content_type == "application/xml" or content_type:sub(-4) == "+xml" then
 		return handle_xml(path, actor, request.body);
 	elseif content_type == "application/json" or content_type:sub(-5) == "+json" then