Currently, hyper and this crate only support status code from [100, 600), otherwise will cause error InvalidStatusCode, which make parse a Response with custom code failed eventually.
For example:
HTTP/1.1 6xx status code 6xx
....
will cause
TRACE:hyper::proto::conn : Conn::read_head
TRACE:hyper::proto::h1::parse : Response.parse([Header; 100], [u8; 447])
TRACE:hyper::proto::h1::parse : Response.parse Complete(409)
TRACE:hyper::proto::conn : State::close_read()
DEBUG:hyper::proto::conn : parse error (Invalid Status provided) with 447 bytes
TRACE:tokio_proto::streaming::pipeline::advanced: process_out_frame
ERROR:tokio_proto::streaming::pipeline::client : pipeline error: An error occurred.
But, sometime, some service will define custom status code, especially in some RESTful API.
So, I think it is fine to support custom code and reason.
Currently, hyper and this crate only support status code from
[100, 600), otherwise will cause errorInvalidStatusCode, which make parse aResponsewith custom code failed eventually.For example:
will cause
But, sometime, some service will define custom status code, especially in some RESTful API.
So, I think it is fine to support custom code and reason.