diff --git a/src/route/container.rs b/src/route/container.rs index e60cc32..6662922 100644 --- a/src/route/container.rs +++ b/src/route/container.rs @@ -53,12 +53,10 @@ async fn get_log( State(state): State, ExtractAccept(accept): ExtractAccept, ) -> impl IntoResponse { - if let Ok(accept_type) = accept.to_str() { - if accept_type == "text/event-stream" { - return get_log_stream(container_name, state).await.into_response(); - } + match accept.to_str() { + Ok("text/event-stream") => get_log_stream(container_name, state).await.into_response(), + _ => get_log_string(container_name, state).await.into_response(), } - get_log_string(container_name, state).await.into_response() } async fn get_log_string(container_name: String, state: AppState) -> impl IntoResponse {