diff --git a/fedimint-core/src/api.rs b/fedimint-core/src/api.rs index 51182d1f81a..95298c7ed30 100644 --- a/fedimint-core/src/api.rs +++ b/fedimint-core/src/api.rs @@ -712,13 +712,11 @@ impl JsonRpcClient for WsClient { #[cfg(not(target_family = "wasm"))] return WsClientBuilder::default() .use_webpki_rustls() - .build(url_to_string_with_default_port(url)) // Hack for default ports, see fn docs + .build(url.as_str()) .await; #[cfg(target_family = "wasm")] - WsClientBuilder::default() - .build(url_to_string_with_default_port(url)) // Hack for default ports, see fn docs - .await + WsClientBuilder::default().build(url.as_str()).await } fn is_connected(&self) -> bool { @@ -847,24 +845,6 @@ impl FederationPeer { } } -/// `jsonrpsee` converts the `SafeUrl` to a `&str` internally and then parses it -/// as an `Uri`. Unfortunately the underlying `Url` type swallows ports that it -/// considers default ports (e.g. 80 and 443 for HTTP(S)) which makes the `Uri` -/// parsing fail in these cases. This function works around this limitation in a -/// limited way (not fully standard compliant, but work for our use case). -/// -/// See -fn url_to_string_with_default_port(url: &SafeUrl) -> String { - format!( - "{}://{}:{}{}", - url.scheme(), - url.host().expect("Asserted on construction"), - url.port_or_known_default() - .expect("Asserted on construction"), - url.path() - ) -} - impl WsFederationApi {} /// The status of a server, including how it views its peers