fix(server): panic on max_buf_size too small

This commit is contained in:
Evan Simmons
2018-04-17 15:26:58 -07:00
parent 4ea5472f90
commit aac250f29d
4 changed files with 28 additions and 0 deletions

View File

@@ -1055,6 +1055,18 @@ fn illegal_request_length_returns_400_response() {
fut.wait().unwrap_err();
}
#[test]
#[should_panic]
fn max_buf_size_panic_too_small() {
const MAX: usize = 8191;
Http::new().max_buf_size(MAX);
}
#[test]
fn max_buf_size_no_panic() {
const MAX: usize = 8193;
Http::new().max_buf_size(MAX);
}
#[test]
fn max_buf_size() {
let _ = pretty_env_logger::try_init();