mirror of
https://github.com/actix/actix-web.git
synced 2025-01-03 13:58:44 +00:00
add Client::headers (#2114)
This commit is contained in:
parent
c49fe79207
commit
1f1be6fd3d
2 changed files with 12 additions and 0 deletions
|
@ -1,11 +1,15 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
### Added
|
||||||
|
* Add `Client::headers` to get default mut reference of `HeaderMap` of client object. [#2114]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* `ConnectorService` type is renamed to `BoxConnectorService`. [#2081]
|
* `ConnectorService` type is renamed to `BoxConnectorService`. [#2081]
|
||||||
* Fix http/https encoding when enabling `compress` feature. [#2116]
|
* Fix http/https encoding when enabling `compress` feature. [#2116]
|
||||||
|
|
||||||
[#2081]: https://github.com/actix/actix-web/pull/2081
|
[#2081]: https://github.com/actix/actix-web/pull/2081
|
||||||
|
[#2114]: https://github.com/actix/actix-web/pull/2114
|
||||||
[#2116]: https://github.com/actix/actix-web/pull/2116
|
[#2116]: https://github.com/actix/actix-web/pull/2116
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -286,4 +286,12 @@ impl Client {
|
||||||
}
|
}
|
||||||
req
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue