I am writing an https client to fetch https raw data using Wolfssl and http-parser. It works on regular HTML pages but not MIME type files.
The problem is that http-parser cannot decide the ending of the HTTP response stream. Based on my reading of the documents of http-parser and http protocol, I know that there are three signals related to the ending of a stream: content-length and '\r\n' after the response body and EOF. However, I found that many HTTP responses which contain a jpeg image don't contain them. For example, the response of this URL has no content-length and no '\r\n' and no EOF. https://raw.githubusercontent.com/wolfSSL/wolfssl-examples/master/SGX_Linux/README-images/expected-make-output.png
I wondered if there are other ways to find the ending of the stream or if there are some bugs in my code?