Fix Sse keepalive build error (#4725)
This commit is contained in:
1 parent
7a4a0ca181
commit
a4aef33369
1 file changed
+4
-4
@@ -350,15 +350,15 @@ mod server_impl {
|
|||||||
|
|
||||||
impl<T> IntoResponse for ServerEvents<T> {
|
impl<T> IntoResponse for ServerEvents<T> {
|
||||||
fn into_response(self) -> axum_core::response::Response {
|
fn into_response(self) -> axum_core::response::Response {
|
||||||
let mut sse = self
|
let sse = self
|
||||||
.sse
|
.sse
|
||||||
.expect("SSE should be initialized before using it as a response");
|
.expect("SSE should be initialized before using it as a response");
|
||||||
|
|
||||||
if let Some(keep_alive) = self.keep_alive {
|
if let Some(keep_alive) = self.keep_alive {
|
||||||
sse = sse.keep_alive(keep_alive)
|
sse.keep_alive(keep_alive).into_response()
|
||||||
|
} else {
|
||||||
|
sse.into_response()
|
||||||
}
|
}
|
||||||
|
|
||||||
sse.into_response()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user