1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 23:17:42 +02:00

add Client::headers (#2114)

This commit is contained in:
fakeshadow
2021-03-31 03:43:56 -07:00
committed by GitHub
parent c49fe79207
commit 1f1be6fd3d
2 changed files with 12 additions and 0 deletions

View File

@ -286,4 +286,12 @@ impl Client {
}
req
}
/// Get default HeaderMap of Client.
///
/// Returns Some(&mut HeaderMap) when Client object is unique
/// (No other clone of client exists at the same time).
pub fn headers(&mut self) -> Option<&mut HeaderMap> {
Rc::get_mut(&mut self.0.headers)
}
}