From e9cebf68ec7eba9c7473f08d3d6463d35bffaf73 Mon Sep 17 00:00:00 2001 From: Albrecht Date: Thu, 31 Oct 2024 19:10:47 +0100 Subject: [PATCH] fix: don't overwrite the url path in twirp-client (#478) --- Cargo.lock | 2 +- livekit-api/src/services/twirp_client.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c109ac0..31372d3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1642,7 +1642,7 @@ dependencies = [ [[package]] name = "livekit-ffi" -version = "0.12.0" +version = "0.12.1" dependencies = [ "console-subscriber", "dashmap", diff --git a/livekit-api/src/services/twirp_client.rs b/livekit-api/src/services/twirp_client.rs index 2939cc26..9dd6c5b5 100644 --- a/livekit-api/src/services/twirp_client.rs +++ b/livekit-api/src/services/twirp_client.rs @@ -102,7 +102,10 @@ impl TwirpClient { mut headers: HeaderMap, ) -> TwirpResult { let mut url = url::Url::parse(&self.host)?; - url.set_path(&format!("{}/{}.{}/{}", self.prefix, self.pkg, service, method)); + + if let Ok(mut segs) = url.path_segments_mut() { + segs.push(&format!("{}/{}.{}/{}", self.prefix, self.pkg, service, method)); + } headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/protobuf"));