diff --git a/cockpit/ui/src-tauri/src/dashboard.rs b/cockpit/ui/src-tauri/src/dashboard.rs index 4afdf81..cd0367c 100644 --- a/cockpit/ui/src-tauri/src/dashboard.rs +++ b/cockpit/ui/src-tauri/src/dashboard.rs @@ -108,7 +108,9 @@ fn telltale_base() -> Option { // No default. An unset base URL means "Intake is not configured on this // machine", which the adapter must be able to tell apart from "configured but // unreachable" — the second greys a lane, the first should not invent one. - std::env::var("TELLTALE_BASE_URL").ok().filter(|s| !s.trim().is_empty()) + std::env::var("TELLTALE_BASE_URL") + .ok() + .filter(|s| !s.trim().is_empty()) } /// `GET {TELLTALE_BASE_URL}/v1/issues` → `{ issues, errors }` (spec §6.3), passed @@ -123,8 +125,8 @@ fn telltale_base() -> Option { #[tauri::command] pub async fn feedback_issues() -> Result { let base = telltale_base().ok_or_else(|| "TELLTALE_BASE_URL is not set".to_string())?; - let token = std::env::var("TELLTALE_TOKEN") - .map_err(|_| "TELLTALE_TOKEN is not set".to_string())?; + let token = + std::env::var("TELLTALE_TOKEN").map_err(|_| "TELLTALE_TOKEN is not set".to_string())?; let url = format!("{}/v1/issues", base.trim_end_matches('/')); let resp = reqwest::Client::new() diff --git a/crates/fleetd/src/server.rs b/crates/fleetd/src/server.rs index b9eda4f..5108c26 100644 --- a/crates/fleetd/src/server.rs +++ b/crates/fleetd/src/server.rs @@ -34,7 +34,6 @@ use axum::{ routing::{get, post}, Json, Router, }; -use tower_http::cors::{AllowOrigin, CorsLayer}; use fleet_core::{Command, Event, GateConfig, Phase, Tier}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -44,6 +43,7 @@ use std::sync::{ }; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use tokio::sync::{broadcast, mpsc, Semaphore}; +use tower_http::cors::{AllowOrigin, CorsLayer}; fn now_ms() -> i64 { SystemTime::now() @@ -2319,7 +2319,10 @@ mod tests { .get(header::ACCESS_CONTROL_ALLOW_METHODS) .map(|v| v.to_str().unwrap().to_string()) .unwrap_or_default(); - assert!(methods.contains("POST"), "POST must be allowed, got {methods:?}"); + assert!( + methods.contains("POST"), + "POST must be allowed, got {methods:?}" + ); } #[tokio::test] @@ -2359,7 +2362,9 @@ mod tests { .unwrap(); assert!( - res.headers().get(header::ACCESS_CONTROL_ALLOW_ORIGIN).is_none(), + res.headers() + .get(header::ACCESS_CONTROL_ALLOW_ORIGIN) + .is_none(), "an unlisted origin must not be granted access", ); }