(self, data: bytes)
| 581 | future_set_result_unless_cancelled(self._finish_future, None) |
| 582 | |
| 583 | def _parse_headers(self, data: bytes) -> Tuple[str, httputil.HTTPHeaders]: |
| 584 | # The lstrip removes newlines that some implementations sometimes |
| 585 | # insert between messages of a reused connection. Per RFC 7230, |
| 586 | # we SHOULD ignore at least one empty line before the request. |
| 587 | # http://tools.ietf.org/html/rfc7230#section-3.5 |
| 588 | data_str = native_str(data.decode("latin1")).lstrip("\r\n") |
| 589 | # RFC 7230 section allows for both CRLF and bare LF. |
| 590 | eol = data_str.find("\n") |
| 591 | start_line = data_str[:eol].rstrip("\r") |
| 592 | headers = httputil.HTTPHeaders.parse(data_str[eol:]) |
| 593 | return start_line, headers |
| 594 | |
| 595 | def _read_body( |
| 596 | self, |
no test coverage detected