Properly wrap HTML for axum root handler

This commit is contained in:
Gabriel Simmer 2023-10-25 21:20:47 +01:00
parent 2297da8e73
commit 012771f2fb
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ

View file

@ -1,4 +1,5 @@
use axum::extract::State;
use axum::response::Html;
use axum::{
body::Full,
http::{Response, StatusCode},
@ -191,8 +192,8 @@ async fn metrics_handler(State(config): State<Config>) -> Result<impl IntoRespon
}
}
async fn homepage() -> &'static str {
r#"<a href="/metrics">/metrics</a>"#
async fn homepage() -> Html<&'static str> {
Html(r#"<a href="/metrics">/metrics</a>"#)
}
async fn metrics(config: Config) -> Result<Vec<u8>, WsError> {