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

XMLHttpRequest missing correct responseType (handling) for binary responses

    XMLWordPrintable

Details

    Description

      XMLHttpRequest returns an empty responseType and then (mis)encodes the response body. An example for a request that returns an audio object:

      Headers:

      Binary rescache-control: private, max-age=86400
      content-length: 782126
      content-type: audio/x-wav
      expires: Tue, 31 May 2016 19:09:26 GMT
      last-modified: Mon, 30 May 2016 19:09:26 GMT
      etag: B5A29D7A5/30/2016 12:09:26 PM
      x-ms-trans-info: 3444.V2_Rest.Speak.4B7660B9
      date: Mon, 30 May 2016 19:09:26 GMT
      

      This is returned as text – it seems the content is interpreted as utf-8, which then means that some bytes get corrupted so "forcing" bytearrays does not help.

      qml: Length: 781899
      qml: xhr.response RIFF&?
      qml: xhr.responseType undefined
      qml: Bytes:
      "0" "52"
      "0" "49"
      "0" "46"
      "0" "46"
      "0" "26"
      "ffffffffffffffff" "fffffffffffffffd"
      "0" "b"
      "0" "0"
      "0" "57"
      

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              achipa Attila Csipa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes