changeset 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
parents af73963cf1dd
children 0992c0398783
files mod_pubsub_post/mod_pubsub_post.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
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