Currently, only the first 1024 bytes of each request is read, hopefully enough to find the HTTP/ marker and parse the method and path:
req = conn.recv(1024).decode(http_encoding)
req_headers = self.parse_headers(req)
That should probably read all headers, or at least until the first newline, using a smaller window and buffer.
Currently, only the first 1024 bytes of each request is read, hopefully enough to find the
HTTP/marker and parse the method and path:That should probably read all headers, or at least until the first newline, using a smaller window and buffer.