From 47f53d231b6a738b8f093b5769428a7e10e80653 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Wed, 20 Nov 2024 12:28:10 +0400 Subject: [PATCH] debug: Add more logs for CORS handling --- api/src/cors.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/cors.rs b/api/src/cors.rs index 45830b9..12fb28e 100644 --- a/api/src/cors.rs +++ b/api/src/cors.rs @@ -16,7 +16,10 @@ impl Fairing for CORS { } async fn on_response<'r>(&self, request: &'r Request<'_>, response: &mut Response<'r>) { + tracing::info!("on_response handler for request: {request:?}"); + tracing::info!("original planned response: {response:?}"); if request.method() == Method::Options { + tracing::info!("request method is OPTIONS"); response.set_status(Status::NoContent); response.set_header(Header::new( "Access-Control-Allow-Methods", @@ -39,5 +42,6 @@ impl Fairing for CORS { } response.set_header(Header::new("Access-Control-Allow-Credentials", "true")); + tracing::info!("response after setting headers: {response:?}"); } }