Headers and response body are not necessarily split into two different streams. Accept the bare minimum # of bytes to get the MIME type, then check to see if a type is present. If not, then the MIME must be an explanation for the response code.
Try splitting based on b'\r\n' to get the end of the response headers.
Headers and response body are not necessarily split into two different streams. Accept the bare minimum # of bytes to get the MIME type, then check to see if a type is present. If not, then the MIME must be an explanation for the response code. Try splitting based on b'\r\n' to get the end of the response headers.