Skip to content

Commit b6931e3

Browse files
authored
Fix: Fixup how the headers are set in spclient to prevent deleting headers (#1552)
1 parent 1a19d94 commit b6931e3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Fixed
1919

20+
- [core] Fixed a problem where in `spclient` where a http 411 error was thrown because the header were set wrong
21+
2022
### Security
2123

2224
## [0.7.0] - 2025-08-24

core/src/spclient.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,12 @@ impl SpClient {
489489
let token = self.session().login5().auth_token().await?;
490490

491491
let headers_mut = request.headers_mut();
492-
if let Some(ref hdrs) = headers {
493-
*headers_mut = hdrs.clone();
492+
if let Some(ref headers) = headers {
493+
for (name, value) in headers {
494+
headers_mut.insert(name, value.clone());
495+
}
494496
}
497+
495498
headers_mut.insert(
496499
AUTHORIZATION,
497500
HeaderValue::from_str(&format!("{} {}", token.token_type, token.access_token,))?,

0 commit comments

Comments
 (0)