Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-53869

MHTML: Document not displayed due to incorrect folding whitespace handling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.4.1, 5.6.0
    • WebEngine, WebKit, WebView
    • None
    • Linux 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux - CentOS release 6.7 (Final)
      Windows Server 2008/2012

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            horst.reiterer Horst Reiterer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes