From c3ac22795288dcb33a729278f5907e66cb6643bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 29 Aug 2023 21:34:00 +0200 Subject: [PATCH] add debug route --- rust/src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rust/src/main.rs b/rust/src/main.rs index 2ee4725..cfdbf29 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -192,6 +192,7 @@ async fn main() -> Result<(), StartError> { }) }), ) + .route("/debug", get(debug)) .nest( (&TopLevelPage::Trips.path()).into(), Router::new() @@ -290,6 +291,17 @@ async fn root() -> impl IntoResponse { view::Root::build(&view::home::Home::build(), None) } +async fn debug(headers: HeaderMap) -> impl IntoResponse { + let out = { + let mut out = String::new(); + for (key, value) in headers.iter() { + out.push_str(&format!("{}: {}\n", key, value.to_str().unwrap())); + } + out + }; + out +} + #[derive(Deserialize, Default)] struct InventoryQuery { edit_item: Option,