1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

add tests for camel case headers rendering

This commit is contained in:
Nikolay Kim
2019-04-24 11:27:57 -07:00
parent 64f603b076
commit 2e19f572ee
7 changed files with 123 additions and 26 deletions

View File

@ -1,5 +1,9 @@
# Changes
### Added
* Allow to send headers in `Camel-Case` form.
## [0.1.1] - 2019-04-19
### Added

View File

@ -235,17 +235,10 @@ impl ClientRequest {
self
}
/// Is to uppercase headers with Camel-Case.
/// Befault is `false`
/// Send headers in `Camel-Case` form.
#[inline]
pub fn upper_camel_case_headers(&self) -> bool {
self.head.upper_camel_case_headers()
}
/// Set `true` to send headers which are uppercased with Camel-Case.
#[inline]
pub fn set_upper_camel_case_headers(&mut self, value: bool) -> &mut Self {
self.head.set_upper_camel_case_headers(value);
pub fn camel_case(mut self) -> Self {
self.head.set_camel_case_headers(true);
self
}

View File

@ -90,6 +90,10 @@ fn test_simple() {
// read response
let bytes = srv.block_on(response.body()).unwrap();
assert_eq!(bytes, Bytes::from_static(STR.as_ref()));
// camel case
let response = srv.block_on(srv.post("/").camel_case().send()).unwrap();
assert!(response.status().is_success());
}
#[test]