Software /
code /
prosody-modules
Changeset
3254:af73963cf1dd
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Aug 2018 14:48:59 +0200 |
parents | 3253:cf8ad9fd7f15 |
children | 3255:64d1dfbd1740 |
files | mod_pubsub_post/mod_pubsub_post.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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