From 67de0523646388a5ceee457a24a825bcf84328ae Mon Sep 17 00:00:00 2001 From: Ruben De Smet Date: Thu, 16 Jan 2025 00:59:09 +0100 Subject: [PATCH] Use Auth header for ws login --- src/push_service/mod.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/push_service/mod.rs b/src/push_service/mod.rs index cd6013f0a..e6242f5f1 100644 --- a/src/push_service/mod.rs +++ b/src/push_service/mod.rs @@ -219,20 +219,16 @@ impl PushService { let mut url = Endpoint::service(path).into_url(&self.cfg)?; url.set_scheme("wss").expect("valid https base url"); - if let Some(credentials) = credentials { - url.query_pairs_mut() - .append_pair("login", &credentials.login()) - .append_pair( - "password", - credentials.password.as_ref().expect("a password"), - ); - } - let mut builder = self.client.get(url); for (key, value) in additional_headers { builder = builder.header(*key, *value); } + if let Some(credentials) = credentials { + builder = + builder.basic_auth(credentials.login(), credentials.password); + } + let ws = builder .upgrade() .send()