This commit is contained in:
Hamcha 2023-11-19 15:14:59 +01:00
parent e085f734f8
commit e45d4c38a0

View file

@ -53,12 +53,10 @@ async fn get_log(
State(state): State<AppState>, State(state): State<AppState>,
ExtractAccept(accept): ExtractAccept, ExtractAccept(accept): ExtractAccept,
) -> impl IntoResponse { ) -> impl IntoResponse {
if let Ok(accept_type) = accept.to_str() { match accept.to_str() {
if accept_type == "text/event-stream" { Ok("text/event-stream") => get_log_stream(container_name, state).await.into_response(),
return 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 { async fn get_log_string(container_name: String, state: AppState) -> impl IntoResponse {