mod_pubsub_post: Make debug messages more informative
authorKim Alvefur <zash@zash.se>
Sat, 30 Mar 2019 21:34:28 +0100
changeset 3508 9ef5b229f73e
parent 3507 882180b459a0
child 3509 106b4ae4469b
mod_pubsub_post: Make debug messages more informative
mod_pubsub_post/mod_pubsub_post.lua
--- 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