From f76331f8826e0c7e79f3d182b88377d1a55a9c0b Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 15 May 2020 01:00:19 +0300 Subject: [PATCH] Use the /dns protocol in websocket redirects The whole thing with back-translating from an redirect URL looks a bit baroque, but at least now the transport does not completely ignore IPv6 addresses resolved from a hostname in a redirect URL. --- transports/websocket/src/framed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transports/websocket/src/framed.rs b/transports/websocket/src/framed.rs index 2c11e48cbe0..182b81ab68b 100644 --- a/transports/websocket/src/framed.rs +++ b/transports/websocket/src/framed.rs @@ -373,7 +373,7 @@ fn location_to_multiaddr(location: &str) -> Result> { let mut a = Multiaddr::empty(); match url.host() { Some(url::Host::Domain(h)) => { - a.push(Protocol::Dns4(h.into())) + a.push(Protocol::Dns(h.into())) } Some(url::Host::Ipv4(ip)) => { a.push(Protocol::Ip4(ip))