diff --git a/fedimint-core/src/api.rs b/fedimint-core/src/api.rs index e7a0679a8b1..e27810d0e33 100644 --- a/fedimint-core/src/api.rs +++ b/fedimint-core/src/api.rs @@ -726,13 +726,13 @@ impl JsonRpcClient for WsClient { return WsClientBuilder::default() .use_webpki_rustls() .max_concurrent_requests(u16::MAX as usize) - .build(url_to_string_with_default_port(url)) // Hack for default ports, see fn docs + .build(url.as_str()) // Hack for default ports, see fn docs .await; #[cfg(target_family = "wasm")] WsClientBuilder::default() .max_concurrent_requests(u16::MAX as usize) - .build(url_to_string_with_default_port(url)) // Hack for default ports, see fn docs + .build(url.as_str()) // Hack for default ports, see fn docs .await } @@ -862,24 +862,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