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