Software /
code /
prosody-modules
Changeset
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 |
parents | 3503:882180b459a0 |
children | 3505:106b4ae4469b |
files | mod_pubsub_post/mod_pubsub_post.lua |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
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