Skip to content

Commit

Permalink
fix: don't overwrite the url path in twirp-client (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
weichweich authored Oct 31, 2024
1 parent bc73684 commit e9cebf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion livekit-api/src/services/twirp_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ impl TwirpClient {
mut headers: HeaderMap,
) -> TwirpResult<R> {
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"));

Expand Down

0 comments on commit e9cebf6

Please sign in to comment.