From 3281f1ebe1260eb4992379c1c02cd360e7bfc8e5 Mon Sep 17 00:00:00 2001 From: agokarn Date: Mon, 18 Nov 2024 07:02:58 +0000 Subject: [PATCH] Log incoming request id as well to correlate logs. --- ohttp-server/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ohttp-server/src/main.rs b/ohttp-server/src/main.rs index f662de4..f3c8fdf 100755 --- a/ohttp-server/src/main.rs +++ b/ohttp-server/src/main.rs @@ -366,7 +366,13 @@ async fn score( info!("Received encapsulated score request for target {}", target); info!("Request headers length = {}", headers.len()); - let return_token = headers.contains_key("x-attestation-token"); + for (key, value) in &headers { + info!( + " {}: {}", + key, + std::str::from_utf8(value.as_bytes()).unwrap() + ); + } // The KID is normally the first byte of the request let kid = match body.first().copied() { @@ -442,6 +448,7 @@ async fn score( warp::http::Response::builder().header("Content-Type", "message/ohttp-chunked-res"); // Add HTTP header with MAA token, for client auditing. + let return_token = headers.contains_key("x-attestation-token"); if return_token { builder = builder.header( HeaderName::from_static("x-attestation-token"),