Browse Source

web: serve UI as text/html (Html wrapper, not raw &str)

Alexander Korolev 2 months ago
parent
commit
f3a8bb7f3b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/web/mod.rs

+ 2 - 2
src/web/mod.rs

@@ -19,7 +19,7 @@ use axum::{
     http::{HeaderMap, Request, StatusCode},
     middleware::{self, Next},
     response::{
-        Response,
+        Html, Response,
         sse::{Event as SseEvent, Sse},
     },
     routing::get,
@@ -120,7 +120,7 @@ pub fn router(app: AppState) -> Router {
         .route("/events", get(events_stream))
         .layer(middleware::from_fn_with_state(app.clone(), token_guard));
     Router::new()
-        .route("/", get(|| async { UI_HTML }))
+        .route("/", get(|| async { Html(UI_HTML) }))
         .merge(protected)
         .with_state(app)
 }