Skip to content

Commit

Permalink
Use Auth header for ws login
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 15, 2025
1 parent dd43d93 commit af0a0fc
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/push_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,25 @@ 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"),
);
}
// 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()
Expand Down

0 comments on commit af0a0fc

Please sign in to comment.