1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 09:49:31 +02:00

Fix: Fixup how the headers are set in spclient to prevent deleting headers (#1552)

This commit is contained in:
Felix Prillwitz 2025-08-27 00:53:12 +02:00 committed by GitHub
parent 1a19d94063
commit b6931e3de5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- [core] Fixed a problem where in `spclient` where a http 411 error was thrown because the header were set wrong
### Security ### Security
## [0.7.0] - 2025-08-24 ## [0.7.0] - 2025-08-24

View file

@ -489,9 +489,12 @@ impl SpClient {
let token = self.session().login5().auth_token().await?; let token = self.session().login5().auth_token().await?;
let headers_mut = request.headers_mut(); let headers_mut = request.headers_mut();
if let Some(ref hdrs) = headers { if let Some(ref headers) = headers {
*headers_mut = hdrs.clone(); for (name, value) in headers {
headers_mut.insert(name, value.clone());
}
} }
headers_mut.insert( headers_mut.insert(
AUTHORIZATION, AUTHORIZATION,
HeaderValue::from_str(&format!("{} {}", token.token_type, token.access_token,))?, HeaderValue::from_str(&format!("{} {}", token.token_type, token.access_token,))?,