From 8c8744ac544b96bd092ce09291150b22ff80a2e2 Mon Sep 17 00:00:00 2001 From: fozzie Date: Sun, 20 Jul 2025 23:39:44 -0500 Subject: [PATCH] log tweaks --- src/handler.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index f753103..a72be4d 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -68,7 +68,10 @@ pub async fn check_canary_result( return error_response(StatusCode::BAD_REQUEST, "URI missing from form data".to_string()); }; - info!("IP {:?} ... Checking canary at {}", headers.get("X-Forwarded-For"), uri); + match headers.get("X-Forwarded-For") { + Some(remote_addr) => info!("IP {:?} ... Checking canary at {}", remote_addr, uri), + None => info!("IP unavailable ... Checking canary at {}", uri), + } match ureq::get(uri.clone()).call() { Ok(mut resp) => match resp.body_mut().read_to_string() { @@ -100,9 +103,9 @@ fn read_verifier(mut verifier: Verifier<'_,Helper>, url: String, state: State, helper: Helper, url: String, State(state): State) -> CheckResponse { match String::from_utf8(content) { Ok(content) => { - info!("Good signature from {:?} ({:?})", - helper.get_fingerprint(), - helper.get_description()); + info!("Good signature from {} ({})", + helper.get_fingerprint().unwrap(), + helper.get_description().unwrap()); (StatusCode::OK,Html(ShowCheckFormTemplate{ url: Some(url), -- 2.52.0