From dbb798a408d3ff308dabe8272b29ec8f19b6eec3 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Wed, 30 Aug 2023 16:23:37 +0200 Subject: [PATCH] [fix] [#434] Don't log ring request on missing client id Motivations for change: 1. Full ring req is an unnecessary amount of info, and may produce a lot of log noise. 2. Sensitive info can be (and often is) in ring requests. 3. Users can anyway catch the exception which includes the request if they really need it. Thanks to @NoahTheDuke for the report! --- src/taoensso/sente.cljc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/taoensso/sente.cljc b/src/taoensso/sente.cljc index 3adb639..8ad4d26 100644 --- a/src/taoensso/sente.cljc +++ b/src/taoensso/sente.cljc @@ -749,8 +749,8 @@ (enc/cond (str/blank? client-id) (let [err-msg "Client's Ring request doesn't have a client id. Does your server have the necessary keyword Ring middleware (`wrap-params` & `wrap-keyword-params`)?"] - (timbre/errorf (str err-msg ": %s") ring-req) ; Careful re: % in req - (throw (ex-info err-msg {:ring-req ring-req}))) + (timbre/error (str err-msg ": " lid*)) + (throw (ex-info err-msg {:ring-req ring-req, :lid lid*}))) :if-let [resp (possible-rejection-resp ring-req)] resp