]> Humopery - waterslager.git/commitdiff
log tweaks
authorfozzie <fozzie@humopery.space>
Mon, 21 Jul 2025 04:39:44 +0000 (23:39 -0500)
committerfozzie <fozzie@humopery.space>
Mon, 21 Jul 2025 04:39:44 +0000 (23:39 -0500)
src/handler.rs

index f75310392e90770884cfb856ebd0d55a0ff51bea..a72be4d69e1b42e6b6e13254f5a29fb7ebc05ede 100644 (file)
@@ -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<Ap
 fn decode_message_bytes(content: Vec<u8>, helper: Helper, url: String, State(state): State<AppState>) -> 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),