# HG changeset patch # User Kim Alvefur # Date 1535114939 -7200 # Node ID af73963cf1dd84b163e58c0f85200171dd4dc8d5 # Parent cf8ad9fd7f15d0a7dbd78a603ccb4420d263cab4 mod_pubsub_post: Start with actor unset This should make it easier to add actor models in future commits without defaulting to the superuser by default. diff -r cf8ad9fd7f15 -r af73963cf1dd mod_pubsub_post/mod_pubsub_post.lua --- a/mod_pubsub_post/mod_pubsub_post.lua Tue Aug 21 17:18:31 2018 +0100 +++ b/mod_pubsub_post/mod_pubsub_post.lua Fri Aug 24 14:48:59 2018 +0200 @@ -74,11 +74,13 @@ module:log("debug", "Handling POST: \n%s\n", tostring(request.body)); local content_type = request.headers.content_type or "application/octet-stream"; - local actor = true; + local actor; if actor_source == "request.ip" then actor = request.ip or request.conn:ip(); - elseif actor_source ~= "superuser" then + elseif actor_source == "superuser" then + actor = true; + else module:log("error", "pubsub_post_actor set to unsupported value %q", actor_source); return 500; end