Skip to content

Commit 13b8b5a

Browse files
committed
supports incoming http2 stream
Signed-off-by: Aminu Oluwaseun Joshua <[email protected]> use auto instead Signed-off-by: Aminu Oluwaseun Joshua <[email protected]> cleanup Signed-off-by: Aminu Oluwaseun Joshua <[email protected]>
1 parent 04a3e8e commit 13b8b5a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/trigger-http/src/server.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ use http::{
1414
use http_body_util::BodyExt;
1515
use hyper::{
1616
body::{Bytes, Incoming},
17-
server::conn::http1,
1817
service::service_fn,
1918
};
20-
use hyper_util::rt::TokioIo;
19+
use hyper_util::{
20+
rt::{TokioExecutor, TokioIo},
21+
server::conn::auto::Builder,
22+
};
2123
use spin_app::{APP_DESCRIPTION_KEY, APP_NAME_KEY};
2224
use spin_factor_outbound_http::{OutboundHttpFactor, SelfRequestOrigin};
2325
use spin_factors::RuntimeFactors;
@@ -410,8 +412,7 @@ impl<F: RuntimeFactors> HttpServer<F> {
410412
client_addr: SocketAddr,
411413
) {
412414
task::spawn(async move {
413-
if let Err(err) = http1::Builder::new()
414-
.keep_alive(true)
415+
if let Err(err) = Builder::new(TokioExecutor::new())
415416
.serve_connection(
416417
TokioIo::new(stream),
417418
service_fn(move |request| {

0 commit comments

Comments
 (0)