comparison 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
parents af73963cf1dd
children 1df139b157fb
comparison
equal deleted inserted replaced
3254:af73963cf1dd 3255:64d1dfbd1740
83 else 83 else
84 module:log("error", "pubsub_post_actor set to unsupported value %q", actor_source); 84 module:log("error", "pubsub_post_actor set to unsupported value %q", actor_source);
85 return 500; 85 return 500;
86 end 86 end
87 87
88 if not actor then
89 return 401;
90 end
91
88 if content_type == "application/xml" or content_type:sub(-4) == "+xml" then 92 if content_type == "application/xml" or content_type:sub(-4) == "+xml" then
89 return handle_xml(path, actor, request.body); 93 return handle_xml(path, actor, request.body);
90 elseif content_type == "application/json" or content_type:sub(-5) == "+json" then 94 elseif content_type == "application/json" or content_type:sub(-5) == "+json" then
91 return handle_json(path, actor, request.body); 95 return handle_json(path, actor, request.body);
92 end 96 end