Details
Description
Loading the attached MHTML document (test.mht) in a QWebView results in an empty document. The underlying problem is that the MHTML parser does not parse folding whitespace correctly.
The initial header is as follows:
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_000_0000_01C12184.8FEC43F0"; type=text/html
The second line of the folded Content-Type header starts with a space rather than a tabulator. In RFC2822, folding whitespace is defined as follows:
FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
obs-FWS
So, the second line may start with a space or a tabulator - the input is correct. However, the parser only handles the tabulator case:
qt/qtwebkit/Source/WebCore/platform/network/MIMEHeader.cpp:
if (line[0] == '\t') {
ASSERT(!key.isEmpty());
With the attached patch (qt-everywhere-opensource-5.4.1-html-fws-sp.patch), the document is displayed as expected.