mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 01:39:28 +02:00
Fix: Fixup how the headers are set in spclient
to prevent deleting headers (#1552)
This commit is contained in:
parent
1a19d94063
commit
b6931e3de5
2 changed files with 7 additions and 2 deletions
|
@ -489,9 +489,12 @@ impl SpClient {
|
|||
let token = self.session().login5().auth_token().await?;
|
||||
|
||||
let headers_mut = request.headers_mut();
|
||||
if let Some(ref hdrs) = headers {
|
||||
*headers_mut = hdrs.clone();
|
||||
if let Some(ref headers) = headers {
|
||||
for (name, value) in headers {
|
||||
headers_mut.insert(name, value.clone());
|
||||
}
|
||||
}
|
||||
|
||||
headers_mut.insert(
|
||||
AUTHORIZATION,
|
||||
HeaderValue::from_str(&format!("{} {}", token.token_type, token.access_token,))?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue