When using keep-alive connections, some HTTP implementations insert unexpected and extra CRLF tokens between each connection, which can result in the next request being prefixed with a CRLF.
Some other client/server implementations are tollerant of this, and for example this bug doesn't show up when using the Go net/http library.
self._finish_future.set_result(None)
def _parse_headers(self, data):
- data = native_str(data.decode('latin1'))
+ data = native_str(data.decode('latin1')).lstrip("\r\n")
eol = data.find("\r\n")
start_line = data[:eol]
try: