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:
@ -1,5 +1,9 @@
|
||||
# Changes
|
||||
|
||||
### Added
|
||||
|
||||
* Allow to send headers in `Camel-Case` form.
|
||||
|
||||
## [0.1.1] - 2019-04-19
|
||||
|
||||
### Added
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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]
|
||||
|
Reference in New Issue
Block a user