From c60a5ad871ed95933d27d2b6c98b04ab04d567ef Mon Sep 17 00:00:00 2001 From: shiftinv Date: Sat, 3 Sep 2022 20:13:06 +0200 Subject: [PATCH] feat: log filter reason --- lib/handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/handler.ts b/lib/handler.ts index ecfcbc4..367cd1c 100644 --- a/lib/handler.ts +++ b/lib/handler.ts @@ -1,4 +1,4 @@ -import { http } from "../deps.ts"; +import { http, log } from "../deps.ts"; import { verify } from "./crypto.ts"; import filterWebhook from "./filter.ts"; import { UrlConfig } from "./types.d.ts"; @@ -31,6 +31,7 @@ export default async function handle(req: Request): Promise { // do the thing const filterReason = filterWebhook(req.headers, json, urlConfig); if (filterReason !== null) { + log.debug(`handler: ignored due to '${filterReason}'`); return new Response(`Ignored by webhook filter (reason: ${filterReason})`, { status: 203 }); }