fix: use typed hyper::Error::is_incomplete_message() instead of fragile string matching
This commit is contained in:
@@ -92,9 +92,11 @@ pub async fn serve_https_listener(
|
|||||||
.serve_connection_with_upgrades(io, svc)
|
.serve_connection_with_upgrades(io, svc)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
if e.to_string().contains("incomplete message") {
|
if let Some(hyper_err) = e.downcast_ref::<hyper::Error>() {
|
||||||
|
if hyper_err.is_incomplete_message() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
error!(error = %e, "HTTPS connection error");
|
error!(error = %e, "HTTPS connection error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user