From 559fe35e1bbce5d87bad2c98482ce91f469e944e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 20 Apr 2022 15:08:47 +0200 Subject: [PATCH] fix(sdk): Bind SSO login server to 127.0.0.1 instead of localhost Avoid name resolution failure in some devices --- crates/matrix-sdk/src/client/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index c30026afc..ada960d19 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -761,7 +761,7 @@ impl Client { /// `Err`, the error will be forwarded. /// /// * `server_url` - The local URL the server is going to try to bind to, e.g. `http://localhost:3030`. - /// If `None`, the server will try to open a random port on localhost. + /// If `None`, the server will try to open a random port on `127.0.0.1`. /// /// * `server_response` - The text that will be shown on the webpage at the /// end of the login process. This can be an HTML page. If `None`, a @@ -855,7 +855,7 @@ impl Client { Err(err) => return Err(IoError::new(IoErrorKind::InvalidData, err).into()), }, None => { - Url::parse("http://localhost:0/").expect("Couldn't parse good known localhost URL") + Url::parse("http://127.0.0.1:0/").expect("Couldn't parse good known localhost URL") } };