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>,
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 {