From 0b05c5903e86327cc9cb4cac39217e496851fce3 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Sun, 29 Nov 2015 16:52:18 +0000 Subject: [PATCH] fix(server): Removed check for GET/HEAD request when parsing body Fixes #698 --- src/server/request.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/request.rs b/src/server/request.rs index 1054c25fbd..aa4740366e 100644 --- a/src/server/request.rs +++ b/src/server/request.rs @@ -9,7 +9,7 @@ use std::time::Duration; use buffer::BufReader; use net::NetworkStream; use version::{HttpVersion}; -use method::Method::{self, Get, Head}; +use method::Method; use header::{Headers, ContentLength, TransferEncoding}; use http::h1::{self, Incoming, HttpReader}; use http::h1::HttpReader::{SizedReader, ChunkedReader, EmptyReader}; @@ -41,9 +41,7 @@ impl<'a, 'b: 'a> Request<'a, 'b> { debug!("Request Line: {:?} {:?} {:?}", method, uri, version); debug!("{:?}", headers); - let body = if method == Get || method == Head { - EmptyReader(stream) - } else if headers.has::() { + let body = if headers.has::() { match headers.get::() { Some(&ContentLength(len)) => SizedReader(stream, len), None => unreachable!()