debug_headers.rs
1 use rocket::{ 2 request::{self, FromRequest}, 3 Request, 4 }; 5 6 pub struct DebugHeaders; 7 8 #[rocket::async_trait] 9 impl<'r> FromRequest<'r> for DebugHeaders { 10 type Error = String; 11 12 async fn from_request(req: &'r Request<'_>) -> request::Outcome<Self, Self::Error> { 13 req.headers().iter().for_each(|h| { 14 info!("HEADER: {h:?}"); 15 }); 16 17 request::Outcome::Success(Self {}) 18 } 19 }