HttpResponse doesn't parse response body without Content-Length header and Connection: close #14
Closed
Description
Steps to reproduce:
- create server that replies on request with response:
HTTP/1.1 200 OK
Server: nginx/1.4.3
Date: Mon, 24 Feb 2014 13:38:02 GMT
Content-Type: text/plain
Connection: close
Expires: Mon, 24 Feb 2014 13:38:01 GMT
Cache-Control: no-cache
MESSAGE_BODY
- run curl example:
python examples/curl.py http://video-1-1.rutube.ru/api/tx_bytes
- GET empty response body in stdout.
That's because in HttpResponse.start method HttpPayloadParser is constructed with only message argument.
So, in HttpPayloadParser.__init__ field self.readall defaults to False and next code in HttpPayloadParser.__call__ is never called:
if self.readall:
yield from self.parse_eof_payload(out, buf)