Skip to content

Commit

Permalink
fix remote uri inference
Browse files Browse the repository at this point in the history
  • Loading branch information
stuqdog committed Jun 7, 2024
1 parent fadd59d commit aae9280
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/rpc/dial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ impl DialBuilder<WithoutCredentials> {
let uri2 = original_uri.clone();
let uri = infer_remote_uri_from_authority(original_uri);
let domain = uri2.authority().to_owned().unwrap().as_str();
let domain = amend_domain_if_local(domain);

let mdns_uri = mdns_uri.and_then(|p| Uri::from_parts(p).ok());
let attempting_mdns = mdns_uri.is_some();
Expand Down Expand Up @@ -1226,11 +1225,10 @@ fn encode_sdp(sdp: RTCSessionDescription) -> Result<String> {
}

fn infer_remote_uri_from_authority(uri: Uri) -> Uri {
let is_local_connection = uri
.authority()
.map(Authority::as_str)
.unwrap_or_default()
.contains(".local.cloud");
let authority = uri.authority().map(Authority::as_str).unwrap_or_default();
let is_local_connection = authority.contains(".local.viam.cloud")
|| authority.contains("localhost")
|| authority.contains("0.0.0.0");

if !is_local_connection {
if let Some((new_uri, _)) = Options::infer_signaling_server_address(&uri) {
Expand Down

0 comments on commit aae9280

Please sign in to comment.