From 81fb5240598877f1d50a50da651e9ea5ce3ed184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Tue, 16 Jan 2024 22:42:56 +0100 Subject: [PATCH] fix http2 request --- src/tunnel/transport/http2.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tunnel/transport/http2.rs b/src/tunnel/transport/http2.rs index 7c8ff39..95399f5 100644 --- a/src/tunnel/transport/http2.rs +++ b/src/tunnel/transport/http2.rs @@ -5,7 +5,7 @@ use anyhow::{anyhow, Context}; use bytes::{Bytes, BytesMut}; use http_body_util::{BodyExt, BodyStream, StreamBody}; use hyper::body::{Frame, Incoming}; -use hyper::header::{AUTHORIZATION, COOKIE, HOST}; +use hyper::header::{AUTHORIZATION, COOKIE}; use hyper::http::response::Parts; use hyper::Request; use hyper_util::rt::{TokioExecutor, TokioIo, TokioTimer}; @@ -110,13 +110,11 @@ pub async fn connect( let mut req = Request::builder() .method("POST") .uri(format!( - "{}://{}:{}/{}/events", + "{}://{}/{}/events", client_cfg.remote_addr.scheme(), - client_cfg.remote_addr.host(), - client_cfg.remote_addr.port(), + client_cfg.http_header_host.to_str().unwrap(), &client_cfg.http_upgrade_path_prefix )) - .header(HOST, &client_cfg.http_header_host) .header(COOKIE, tunnel_to_jwt_token(request_id, dest_addr)) .version(hyper::Version::HTTP_2);