Changed the way we handle TransferEncoding
and added new test cases.
Signed-off-by: cihodar <cihodar@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
In Rust 2018 edition, it is considered unidiomatic to use "extern crate"
sunthax. The proper way to do it is to replace extern crate with "use"
declarations.
- Also impl clippy suggestions for fn main removal in doctests
- Fix unneeded box allocations and clones
Signed-off-by: Damien Stanton <damien.stanton@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
...and a bunch of fixes for unchecked unsigned arithmetic
in connection.rs. Added more unit tests too that exercise
failure cases for over/underflows in mathematic operations.
Fixes#1977
Signed-off-by: Alexandra Iordache <aghecen@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
Any number of whitespace characters are accepted after ":"
when parsing HTTP headers.
Create a test function (Add test_parse_header_whitespace).
This test addresses parsing header and allow no space and
any amount of linear white space after ":". And modified
CHANGELOG.md.
Signed-off-by: Eisuke Matsushita <ei13suke@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
When server returns `Method Not Allow` responses,
it can attach to the response a HTTP `Allow` header.
Added support for HTTP response `Allow` header as
well.
Signed-off-by: Iulian Barbu <iul@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
Use case-insensitive check since some http clients use lower case
headers.
Signed-off-by: Bob Potter <bobby.potter@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
Route request according to {method, path} tuple, so we could use only
one router for each http server.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Import vmm/src/api/http.rs from Cloud Hyerpvisor project, commit
345c922cb9a88183e2da9d29230ecb945b0a6452 with following changes:
1) use generic type for handler argument.
2) remove server thread relative code.
3) add unit test cases.
4) refine for better code reuse.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
It's almost an illegal input for a Content-Length header with negative
value, so reject it. Otherwise it may cause unexpected behavor when
parsing/receiving http requests.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Pulled the code from firecracker-microvm/src/micro-http.
Signed-off-by: George Pisaltu <gpl@amazon.com>
Signed-off-by: Andreea Florescu <fandree@amazon.com>