summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index 9aef3d370..aabf5d839 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -108,7 +108,14 @@ impl HyperService<Request<Body>> for Service {
response_tx: resp_tx,
});
- async move { Ok(resp_rx.await.unwrap()) }.boxed_local()
+ async move {
+ resp_rx.await.or_else(|_|
+ // Fallback dummy response in case sender was dropped due to closed conn
+ Response::builder()
+ .status(hyper::StatusCode::INTERNAL_SERVER_ERROR)
+ .body(vec![].into()))
+ }
+ .boxed_local()
}
}