From 59510f930ff2c5238bd0c407d5b89227d8e45457 Mon Sep 17 00:00:00 2001 From: Alex Rudy Date: Thu, 16 May 2024 16:31:31 +0000 Subject: [PATCH] [h2c] example should use serve_connection_with_upgrades Server has to explicitly opt-in to upgrade support. --- examples/src/h2c/server.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/src/h2c/server.rs b/examples/src/h2c/server.rs index 5b116eab9..da5c3425c 100644 --- a/examples/src/h2c/server.rs +++ b/examples/src/h2c/server.rs @@ -52,8 +52,10 @@ async fn main() -> Result<(), Box> { let router = h2c.clone(); tokio::spawn(async move { let builder = Builder::new(TokioExecutor::new()); - let conn = builder - .serve_connection(TokioIo::new(io), TowerToHyperService::new(router)); + let conn = builder.serve_connection_with_upgrades( + TokioIo::new(io), + TowerToHyperService::new(router), + ); let _ = conn.await; }); }