fix(server): GET requests with no body have None instead of Empty

Closes #1373
This commit is contained in:
Sean McArthur
2017-11-14 11:52:29 -08:00
parent b1785c662b
commit 8bf7964875
4 changed files with 55 additions and 13 deletions

View File

@@ -168,16 +168,16 @@ impl<B> From<http::Request<B>> for Request<B> {
}
/// Constructs a request using a received ResponseHead and optional body
pub fn from_wire<B>(addr: Option<SocketAddr>, incoming: RequestHead, body: B) -> Request<B> {
pub fn from_wire(addr: Option<SocketAddr>, incoming: RequestHead, body: Option<Body>) -> Request<Body> {
let MessageHead { version, subject: RequestLine(method, uri), headers } = incoming;
Request::<B> {
Request {
method: method,
uri: uri,
headers: headers,
version: version,
remote_addr: addr,
body: Some(body),
body: body,
is_proxy: false,
}
}