Skip to content

Commit

Permalink
fix(blocking): Fix .header() unsetting sensitive on HeaderValue (
Browse files Browse the repository at this point in the history
  • Loading branch information
Ten0 committed Jul 14, 2024
1 parent 892569e commit 9e577f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/blocking/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ impl RequestBuilder {
match <HeaderName as TryFrom<K>>::try_from(key) {
Ok(key) => match <HeaderValue as TryFrom<V>>::try_from(value) {
Ok(mut value) => {
value.set_sensitive(sensitive);
// We want to potentially make an unsensitive header
// to be sensitive, not the reverse. So, don't turn off
// a previously sensitive header.
if sensitive {
value.set_sensitive(true);
}
req.headers_mut().append(key, value);
}
Err(e) => error = Some(crate::error::builder(e.into())),
Expand Down

0 comments on commit 9e577f5

Please sign in to comment.