match
This commit is contained in:
parent
e085f734f8
commit
e45d4c38a0
1 changed files with 3 additions and 5 deletions
|
@ -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 {
|
||||||
|
|
Reference in a new issue