diff --git a/gunicorn/http/request.py b/gunicorn/http/request.py index 29f610ed..6e0efdc8 100644 --- a/gunicorn/http/request.py +++ b/gunicorn/http/request.py @@ -70,8 +70,8 @@ class Request(object): buf.write(data) buf2 = self.parser.filter_headers(headers, buf) if buf2: - break - + break + self.log.debug("%s", self.parser.status) self.log.debug("Headers:\n%s" % headers) @@ -79,7 +79,8 @@ class Request(object): self._sock.send("HTTP/1.1 100 Continue\r\n\r\n") if not self.parser.content_len and not self.parser.is_chunked: - wsgi_input = StringIO() + wsgi_input = TeeInput(self._sock, self.parser, StringIO(), + self.conf) content_length = "0" else: wsgi_input = TeeInput(self._sock, self.parser, buf2, self.conf) diff --git a/gunicorn/http/tee.py b/gunicorn/http/tee.py index f74eedbd..c341a9c1 100644 --- a/gunicorn/http/tee.py +++ b/gunicorn/http/tee.py @@ -148,7 +148,10 @@ class TeeInput(object): __next__ = next def __iter__(self): - return self + return self + + def get_socket(self): + return self._sock.dup() def _tee(self, length): """ fetch partial body"""