Software /
code /
prosody-modules
Diff
mod_pubsub_post/mod_pubsub_post.lua @ 3504:9ef5b229f73e
mod_pubsub_post: Make debug messages more informative
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 30 Mar 2019 21:34:28 +0100 |
parent | 3503:882180b459a0 |
child | 3793:0d3926e49b55 |
line wrap: on
line diff
--- a/mod_pubsub_post/mod_pubsub_post.lua Sat Mar 30 21:16:13 2019 +0100 +++ b/mod_pubsub_post/mod_pubsub_post.lua Sat Mar 30 21:34:28 2019 +0100 @@ -95,13 +95,15 @@ function handle_POST(event, path) local request = event.request; - module:log("debug", "Handling POST: \n%s\n", tostring(request.body)); local content_type = request.headers.content_type or "application/octet-stream"; local actor = actors and actors[path] or default_actor or request.ip; local secret = actor_secrets and actor_secrets[path] or default_secret; + module:log("debug", "Handling POST to node %q by %q with %q: \n%s\n", path, actor, content_type, request.body); + if secret and not verify_signature(secret, request.body, request.headers.x_hub_signature) then + module:log("debug", "Signature validation failed"); return 401; end