Skip to content

HttpResponse doesn't parse response body without Content-Length header and Connection: close #14

Closed
@tumb1er

Description

Steps to reproduce:

  1. 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
  1. run curl example:
python examples/curl.py http://video-1-1.rutube.ru/api/tx_bytes
  1. 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)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions